feat: 更新版本至 0.0.56,增强登录缓存功能,添加 token 有效性检查

This commit is contained in:
2026-02-21 02:58:23 +08:00
parent 15fd2d3dc8
commit c97e246ba7
3 changed files with 38 additions and 7 deletions

View File

@@ -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) {