feat: 功能优化

This commit is contained in:
2026-01-17 14:43:42 +08:00
parent 5ed0cfff07
commit fecd47e25d
60 changed files with 3529 additions and 827 deletions

View File

@@ -5,25 +5,8 @@
* - ✅ 安全存储访问令牌、刷新令牌、过期时间等信息
* - ✅ 自动检查令牌是否过期(支持提前刷新缓冲时间)
* * ✅ 提供订阅者模式,监听令牌变化事件
* ✅ 兼容旧版本 API提供 getToken()、removeToken() 等方法
*
* 使用示例:
* ```javascript
* import { getAccessToken, setTokens, isLoggedIn } from '@gold/utils/token-manager'
*
* // 检查登录状态
* if (isLoggedIn()) {
* const token = getAccessToken()
* }
*
* // 设置令牌
* setTokens({
* accessToken: 'eyJ...',
* refreshToken: 'eyJ...',
* expiresIn: 7200,
* tokenType: 'Bearer'
* })
* ```
*/
// localStorage 中存储的键名常量