refactor: ♻️ 字典重构,系统权限模块优化

This commit is contained in:
hxr
2024-06-24 08:21:46 +08:00
parent 239989f4aa
commit d5dfcb978e
43 changed files with 1243 additions and 1821 deletions

View File

@@ -1,54 +0,0 @@
import request from "@/utils/request";
import { CaptchaResult, LoginData, LoginResult } from "./model";
const AUTH_BASE_URL = "/api/v1/auth";
class AuthAPI {
/**
* 登录API
*
* @param data 登录数据
* @returns 登录结果
*/
static login(data: LoginData) {
const formData = new FormData();
formData.append("username", data.username);
formData.append("password", data.password);
formData.append("captchaKey", data.captchaKey || "");
formData.append("captchaCode", data.captchaCode || "");
return request<any, LoginResult>({
url: `${AUTH_BASE_URL}/login`,
method: "post",
data: formData,
headers: {
"Content-Type": "multipart/form-data",
},
});
}
/**
* 注销API
*
* @returns 请求结果
*/
static logout() {
return request({
url: `${AUTH_BASE_URL}/logout`,
method: "delete",
});
}
/**
* 获取验证码
*
* @returns 验证码结果
*/
static getCaptcha() {
return request<any, CaptchaResult>({
url: `${AUTH_BASE_URL}/captcha`,
method: "get",
});
}
}
export default AuthAPI;