scan the QR code to log in on the WeChat public account

This commit is contained in:
landaiqing
2024-08-15 23:57:12 +08:00
parent cab3b1ee96
commit 3140eaca99
11 changed files with 432 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
import {service} from "@/utils/alova/service.ts";
import {PhoneLogin} from "@/types/user";
import {AccountLogin, PhoneLogin, ResetPassword} from "@/types/user";
/**
* 获取用户信息
@@ -64,3 +64,38 @@ export const phoneLoginApi = (param: PhoneLogin) => {
}
);
};
/**
* 账号登录
* @param param
*/
export const accountLoginApi = (param: AccountLogin) => {
return service.Post('/api/user/login', {
account: param.account,
password: param.password,
},
{
meta: {
ignoreToken: true,
authRole: 'login'
}
}
);
};
/**
* 重置密码
* @param param
*/
export const resetPasswordApi = (param: ResetPassword) => {
return service.Post('/api/user/reset_password', {
phone: param.phone,
captcha: param.captcha,
password: param.password,
repassword: param.repassword
},
{
meta: {
ignoreToken: true,
}
}
);
};