修改请求接口地址,修改登录参数

This commit is contained in:
2025-02-11 18:10:25 +08:00
parent 6a10005af5
commit a599adc63e
5 changed files with 70 additions and 10 deletions

61
src/api/account/login.ts Normal file
View File

@@ -0,0 +1,61 @@
import request from "@/utils/request";
const baseURL = "account/admin/";
const AuthAPI = {
/** 登录接口*/
login(data: LoginFormData) {
return request<any, LoginResult>({
url: `${baseURL}auth/login`,
method: "post",
data: data,
});
},
/** 获取验证码接口*/
getCaptcha() {
return request<any, CaptchaInfo>({
url: `${baseURL}auth/captcha`,
method: "get",
});
},
/**getPermission */
getPermission() {
return request<any, CaptchaInfo>({
url: `${baseURL}auth/permission`,
method: "get",
});
},
};
export default AuthAPI;
/** 登录表单数据 */
export interface LoginFormData {
/** 用户名 */
username: string;
/** 密码 */
password: string;
/** 验证码缓存uuid */
uuid: string;
/** 验证码 */
code: string;
/** 登录类型
* 0:商户登录
* 1:员工登录
*/
loginType: number;
}
/** 登录响应 */
export interface LoginResult {
/** 访问令牌 */
token: string;
}
/** 验证码信息 */
export interface CaptchaInfo {
/** 验证码缓存uuid */
uuid: string;
/** 验证码图片Base64字符串 */
code: string;
}