tj
This commit is contained in:
@@ -7,7 +7,7 @@ const config: {
|
||||
/**
|
||||
* api请求基础路径
|
||||
*/
|
||||
base_url: 'http://localhost' + import.meta.env.VITE_API_BASEPATH,
|
||||
base_url: import.meta.env.VITE_API_BASEPATH,
|
||||
/**
|
||||
* 接口成功返回状态码
|
||||
*/
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user