You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
import { http } from "@/utils/http";
|
|
|
|
|
|
|
|
|
|
export type UserResult = {
|
|
|
|
|
success: boolean;
|
|
|
|
|
data: {
|
|
|
|
|
/** 用户名 */
|
|
|
|
|
userAccount: string;
|
|
|
|
|
/** `token` */
|
|
|
|
|
accessToken: string;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export type RefreshTokenResult = {
|
|
|
|
|
success: boolean;
|
|
|
|
|
data: {
|
|
|
|
|
/** `token` */
|
|
|
|
|
accessToken: string;
|
|
|
|
|
/** 用于调用刷新`accessToken`的接口时所需的`token` */
|
|
|
|
|
refreshToken: string;
|
|
|
|
|
/** `accessToken`的过期时间(格式'xxxx/xx/xx xx:xx:xx') */
|
|
|
|
|
expires: Date;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 登录 */
|
|
|
|
|
export const getLogin = (data?: object) => {
|
|
|
|
|
return http.request<UserResult>("post", "/virtual-patient/user/login", {
|
|
|
|
|
data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 刷新token */
|
|
|
|
|
export const refreshTokenApi = (data?: object) => {
|
|
|
|
|
return http.request<RefreshTokenResult>("post", "/refreshToken", { data });
|
|
|
|
|
};
|
|
|
|
|
/** 用户注册 */
|
|
|
|
|
export const getRegister = (data?: object) => {
|
|
|
|
|
return http.request<UserResult>("post", "/virtual-patient/user/register", {
|
|
|
|
|
data
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
/** 修改密码 */
|
|
|
|
|
export const changePassWord = (data?: object) => {
|
|
|
|
|
return http.request<UserResult>(
|
|
|
|
|
"post",
|
|
|
|
|
"/virtual-patient/user/changePassWord",
|
|
|
|
|
{
|
|
|
|
|
data
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
};
|