bug修复
This commit is contained in:
1 parent
01b5f47f5c
commit
ef342679ae
2 files changed
+5
-4
No files matched your search
@@ -139,8 +139,10 @@ const getTokenValue = (tokenStorage: any): string | null => {
|
||||
|
||||
// 检查tokenStorage中tokenValue是否过期
|
||||
const isTokenExpires = (tokenStorage: any): boolean => {
|
||||
const { accessToken } = tokenStorage
|
||||
const expiresDate = new Date(accessToken.expiresAt).getTime()
|
||||
const { accessToken } = tokenStorage // 线上token字段
|
||||
const { access_token } = tokenStorage // 测试token字段
|
||||
|
||||
const expiresDate = new Date(accessToken?.expiresAt || access_token?.expiresAt).getTime()
|
||||
return new Date().getTime() >= expiresDate
|
||||
}
|
||||
|
||||
@@ -175,7 +177,6 @@ async function refreshToken(): Promise<any> {
|
||||
})
|
||||
} else {
|
||||
processQueue(new Error("登录失败"), null)
|
||||
throw new Error("登录失败")
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
port: 8888,
|
||||
port: 8889,
|
||||
hmr: true,
|
||||
proxy: {
|
||||
"/api": {
|
||||
|
||||
Reference in new issue
Block a user