Refactor API requests and update component imports

This commit is contained in:
wangqiao
2025-08-18 14:28:10 +08:00
parent 07b4d3de99
commit 9ae3abeded
91 changed files with 669 additions and 884 deletions

View File

@ -1,7 +1,4 @@
import type { AppMemberUserInfoRespVO } from "@/api/common/types";
export type onRefreshTokenResponse = (
data: AxiosResponse | boolean
) => { token: string; refreshToken: string } | false;
import type { AppMemberUserInfoRespVO } from "~/api/common/types";
class RefreshToken {
static instance: RefreshToken;
@ -10,10 +7,10 @@ class RefreshToken {
static SOTRAGE_USERID = "kl-userId";
static SOTRAGE_USERNAME = "kl-userName";
static SOTRAGE_USERINFO = "kl-userInfo";
public pending = false;
public callbacks: any[] = [];
static pending = false;
static callbacks: any[] = [];
protected constructor(config: TRefreshTokenConstructorConfig) {
protected constructor(config: any) {
RefreshToken.SOTRAGE_REFRESH_TOKEN_KEY = config?.refreshTokenKey || "kl-tk";
RefreshToken.SOTRAGE_TOKENKEY = config?.refreshTokenKey || "kl-rfk";
RefreshToken.SOTRAGE_USERID = config?.refreshTokenKey || "kl-userId";
@ -72,4 +69,5 @@ class RefreshToken {
}
}
export default RefreshToken;
const REFRESHTOKEN = RefreshToken;
export default REFRESHTOKEN;