chore: 🔨 合并冲突解决

This commit is contained in:
ray
2024-11-16 22:44:29 +08:00
26 changed files with 1065 additions and 1349 deletions

View File

@@ -3,7 +3,7 @@ import request from "@/utils/request";
const AUTH_BASE_URL = "/api/v1/auth";
const AuthAPI = {
/** 登录 接口*/
/** 登录接口*/
login(data: LoginData) {
const formData = new FormData();
formData.append("username", data.username);
@@ -20,7 +20,19 @@ const AuthAPI = {
});
},
/** 注销 接口*/
/** 刷新 token 接口*/
refreshToken(refreshToken: string) {
return request<any, LoginResult>({
url: `${AUTH_BASE_URL}/refresh-token`,
method: "post",
data: { refreshToken: refreshToken },
headers: {
Authorization: "no-auth",
},
});
},
/** 注销接口*/
logout() {
return request({
url: `${AUTH_BASE_URL}/logout`,
@@ -28,7 +40,7 @@ const AuthAPI = {
});
},
/** 获取验证码 接口*/
/** 获取验证码接口*/
getCaptcha() {
return request<any, CaptchaResult>({
url: `${AUTH_BASE_URL}/captcha`,
@@ -53,14 +65,14 @@ export interface LoginData {
/** 登录响应 */
export interface LoginResult {
/** 访问token */
accessToken?: string;
/** 过期时间(单位:毫秒) */
expires?: number;
/** 刷新token */
refreshToken?: string;
/** token 类型 */
tokenType?: string;
/** 访问令牌 */
accessToken: string;
/** 刷新令牌 */
refreshToken: string;
/** 令牌类型 */
tokenType: string;
/** 过期时间(秒) */
expiresIn: number;
}
/** 验证码响应 */

View File

@@ -61,8 +61,8 @@ const ConfigAPI = {
refreshCache() {
return request({
url: `${CONFIG_BASE_URL}`,
method: "patch",
url: `${CONFIG_BASE_URL}/refresh`,
method: "PUT",
});
},
};

View File

@@ -113,7 +113,7 @@ const UserAPI = {
url: `${USER_BASE_URL}/export`,
method: "get",
params: queryParams,
responseType: "arraybuffer",
responseType: "blob",
});
},