This commit is contained in:
qsh
2024-06-23 16:48:28 +08:00
parent 16e3ac5c6d
commit 43b95e3a10
15 changed files with 42 additions and 23 deletions

View File

@@ -200,14 +200,18 @@ service.interceptors.response.use(
} else {
ElNotification.error({ title: msg })
if (code == 403) {
// 无访问权限,退出登录
const { wsCache } = useCache()
const tenantId = wsCache.get('TENANT_ID')
const appId = wsCache.get('App_ID')
resetRouter() // 重置静态路由表
wsCache.clear()
removeToken()
window.location.href = `/login?tenantId=${tenantId}&appId=${appId}`
ElMessageBox.confirm(`${msg},是否重新登陆`, '提示', {
type: 'warning'
}).then(() => {
// 无访问权限,退出登录
const { wsCache } = useCache()
const tenantId = wsCache.get('TENANT_ID')
const appId = wsCache.get('App_ID')
resetRouter() // 重置静态路由表
wsCache.clear()
removeToken()
window.location.href = `/crm/login?tenantId=${tenantId}&appId=${appId}`
})
}
}
return Promise.reject('error')