feat: 更新版本至 0.0.56,增强登录缓存功能,添加 token 有效性检查
This commit is contained in:
@@ -305,6 +305,9 @@ export class QueryLogin<T extends Cache = Cache> extends BaseQuery {
|
||||
const token = this.storage.getItem('token');
|
||||
return !!token;
|
||||
}
|
||||
async checkTokenValid() {
|
||||
return this.cacheStore.getIsExpired();
|
||||
}
|
||||
/**
|
||||
* 检查本地用户列表
|
||||
* @returns
|
||||
@@ -313,6 +316,7 @@ export class QueryLogin<T extends Cache = Cache> extends BaseQuery {
|
||||
const token = this.storage.getItem('token');
|
||||
return token || '';
|
||||
}
|
||||
|
||||
async beforeRequest(opts: any = {}) {
|
||||
const token = this.storage.getItem('token');
|
||||
if (token) {
|
||||
|
||||
Reference in New Issue
Block a user