🐞 fix:修复从“同时使用了用户信息和权限判断”的页面退出登录时异常问题

This commit is contained in:
preschooler
2024-10-29 12:35:44 +08:00
parent c1924d566f
commit 9b290ae3ce
5 changed files with 15 additions and 9 deletions

View File

@ -10,7 +10,8 @@ const RefreshTokenKey = 'REFRESH_TOKEN'
// 获取token
export const getAccessToken = () => {
// 此处与TokenKey相同此写法解决初始化时Cookies中不存在TokenKey报错
return wsCache.get(AccessTokenKey) ? wsCache.get(AccessTokenKey) : wsCache.get('ACCESS_TOKEN')
const accessToken = wsCache.get(AccessTokenKey)
return accessToken ? accessToken : wsCache.get('ACCESS_TOKEN')
}
// 刷新token