fix: 适配上游 PageQuery 与登录跳转签名并修复弹窗配置类型报错
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import axios, { type AxiosResponse } from "axios";
|
||||
import axios, { type AxiosResponse, type InternalAxiosRequestConfig } from "axios";
|
||||
import qs from "qs";
|
||||
|
||||
import { ApiCodeEnum } from "@/enums/api";
|
||||
@@ -91,7 +91,7 @@ function setupInterceptors(instance: typeof http) {
|
||||
// Token 过期
|
||||
if (code === ApiCodeEnum.ACCESS_TOKEN_INVALID) {
|
||||
if (!config || retriedRequests.has(config)) {
|
||||
await useUserStoreHook().redirectToLogin("expired");
|
||||
await useUserStoreHook().redirectToLogin();
|
||||
return Promise.reject(new Error("Token Invalid"));
|
||||
}
|
||||
|
||||
@@ -108,14 +108,14 @@ function setupInterceptors(instance: typeof http) {
|
||||
|
||||
return instance(config);
|
||||
} catch {
|
||||
await useUserStoreHook().redirectToLogin("expired");
|
||||
await useUserStoreHook().redirectToLogin();
|
||||
return Promise.reject(new Error("Token Invalid"));
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh token 失效
|
||||
if (code === ApiCodeEnum.REFRESH_TOKEN_INVALID) {
|
||||
await useUserStoreHook().redirectToLogin("expired");
|
||||
await useUserStoreHook().redirectToLogin();
|
||||
return Promise.reject(new Error("Token Invalid"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user