This commit is contained in:
qsh
2024-08-01 18:55:41 +08:00
parent 6c035fa0d8
commit e59ba74c12
16 changed files with 136 additions and 130 deletions

View File

@@ -20,7 +20,6 @@ import {
import errorCode from './errorCode'
import { resetRouter } from '@/router'
import { useCache } from '@/hooks/web/useCache'
import cache from '@/plugins/cache'
const { result_code, base_url, request_timeout } = config
@@ -213,11 +212,10 @@ service.interceptors.response.use(
type: 'warning'
}).then(() => {
// 无访问权限,退出登录
const { wsCache } = useCache()
const tenantId = wsCache.get('TENANT_ID')
const appId = wsCache.get('App_ID')
const tenantId = cache.local.get('TENANT_ID')
const appId = cache.local.get('App_ID')
resetRouter() // 重置静态路由表
wsCache.clear()
cache.local.clear()
removeToken()
window.location.href = `/oa/login?tenantId=${tenantId}&appId=${appId}`
})
@@ -259,11 +257,10 @@ const handleAuthorized = () => {
confirmButtonText: t('login.relogin'),
type: 'warning'
}).then(() => {
const { wsCache } = useCache()
const tenantId = wsCache.get('TENANT_ID')
const appId = wsCache.get('App_ID')
const tenantId = cache.local.get('TENANT_ID')
const appId = cache.local.get('App_ID')
resetRouter() // 重置静态路由表
wsCache.clear()
cache.local.clear()
removeToken()
isRelogin.show = false
// 干掉token后再走一次路由让它过router.beforeEach的校验