feat: 添加 token 刷新功能及相关类型定义

- 在 typings.d.ts 中新增 IUserToken 接口
- 在 login.ts 中添加 refreshToken 函数以支持 token 刷新
- 在 types/login.ts 中新增 IUserTokenVo 接口
- 更新 http.ts 以处理 token 刷新逻辑
- 修改 interceptor.ts 以使用新的 token 类型
- 在 user.ts 中整合 token 状态管理
This commit is contained in:
Hygge
2025-08-21 15:49:14 +08:00
parent 6900afa253
commit d9e16baca9
7 changed files with 136 additions and 12 deletions

7
src/typings.d.ts vendored
View File

@@ -21,7 +21,12 @@ declare global {
avatar?: string
/** 微信的 openid非微信没有这个字段 */
openid?: string
token?: string
}
interface IUserToken {
token: string
refreshToken?: string
refreshExpire?: number
}
}