This commit is contained in:
熊潇 2025-03-23 12:27:17 +08:00
parent 54672a5574
commit fdf6d3ac0a

View File

@ -44,7 +44,7 @@ export class QueryLogin {
this.query = query; this.query = query;
} }
private async init() { private async init() {
await this.cacheStore.init() await this.cacheStore.init();
this.load = true; this.load = true;
this.onLoad?.(); this.onLoad?.();
} }
@ -136,6 +136,7 @@ export class QueryLogin {
} }
/** /**
* 401token, refreshToken存在token, 401 * 401token, refreshToken存在token, 401
* 使run401Action 使 afterCheck401ToRefreshToken
* @param response * @param response
* @param ctx * @param ctx
* @param refetch * @param refetch
@ -176,6 +177,7 @@ export class QueryLogin {
/** /**
* 401 401token, refreshToken不存在401 * 401 401token, refreshToken不存在401
* refetch , bug使 * refetch , bug使
* TODO:
* @param response * @param response
* @param ctx * @param ctx
* @param opts * @param opts
@ -232,6 +234,9 @@ export class QueryLogin {
if (config.headers) { if (config.headers) {
config.headers['Authorization'] = `Bearer ${_token}`; config.headers['Authorization'] = `Bearer ${_token}`;
} }
if (!_token) {
// TODO: 取消请求,因为没有登陆
}
return config; return config;
}, },
afterResponse: async (response, ctx) => { afterResponse: async (response, ctx) => {