fix: #I5KCI6

This commit is contained in:
xingyu
2022-08-03 12:38:58 +08:00
parent 55b63c35c9
commit b64261a293
11 changed files with 94 additions and 91 deletions

View File

@ -6,6 +6,7 @@ import { getAccessToken, getRefreshToken, getTenantId, removeToken, setToken } f
import errorCode from './errorCode'
import { useI18n } from '@/hooks/web/useI18n'
import { resetRouter } from '@/router'
import { useCache } from '@/hooks/web/useCache'
const tenantEnable = import.meta.env.VITE_APP_TENANT_ENABLE
const BASE_URL = import.meta.env.VITE_BASE_URL
@ -205,10 +206,12 @@ const handleAuthorized = () => {
type: 'warning'
})
.then(() => {
removeToken()
const { wsCache } = useCache()
resetRouter() // 重置静态路由表
wsCache.clear()
removeToken()
isRelogin.show = false
location.href = '/'
location.href = '/login'
})
.catch(() => {
isRelogin.show = false