feat: 更新版本至 0.0.60,优化登录缓存逻辑,添加 token 过期检查示例

This commit is contained in:
2026-02-24 18:14:42 +08:00
parent df3e5a43fa
commit b32e622707
4 changed files with 56 additions and 46 deletions

View File

@@ -0,0 +1,10 @@
const cacheData = {
accessTokenExpiresIn: 604800,
createdAt: 1771926793545
};
const expiresIn = cacheData.createdAt + cacheData.accessTokenExpiresIn * 1000;
console.log('expiresIn', expiresIn);
const now = Date.now();
console.log('now', now);
console.log('isExpired', now >= expiresIn);