Commit c16d7b4a authored by youjie's avatar youjie

no message

parent 490f8dcf
...@@ -102,22 +102,10 @@ service.interceptors.response.use( ...@@ -102,22 +102,10 @@ service.interceptors.response.use(
ResultMessage.Error(response.data.message) ResultMessage.Error(response.data.message)
console.log(response.data.message) console.log(response.data.message)
setTimeout(() => { setTimeout(() => {
useUserStore().setUserLoginOut() useUserStore().signOutAsync()
}, 1000) }, 1000)
} }
const currentDeniedStatus = useUserStore().getDenied window.location.href = '/login'
if (response.data.resultCode == ApiResult.STATIC_ACCESS) {
useUserStore().setUserDeniedStatus(true)
if (!currentDeniedStatus) window.location.href = '/denyAccess'
} else {
useUserStore().setUserDeniedStatus(false)
if (currentDeniedStatus) window.location.href = '/login'
}
if (response.data.attach) {
if (response.data.attach.userinfo) {
useUserStore().setOnlyUserInfo(response.data.attach.userinfo)
}
}
datas = response datas = response
return Promise.resolve(datas) return Promise.resolve(datas)
} else { } else {
......
...@@ -10,7 +10,6 @@ export const createPermissionGuard = ( ...@@ -10,7 +10,6 @@ export const createPermissionGuard = (
next: NavigationGuardNext, next: NavigationGuardNext,
) => { ) => {
const userStore = useUserStore() const userStore = useUserStore()
//const menus = userStore.getFlattenMenus
// 检查是否是白名单路由 // 检查是否是白名单路由
if (whiteList.includes(to.path)) { if (whiteList.includes(to.path)) {
...@@ -18,6 +17,7 @@ export const createPermissionGuard = ( ...@@ -18,6 +17,7 @@ export const createPermissionGuard = (
return return
} }
// 检查是否是白名单正则路由
if (whiteListRegex.some((regex) => regex.test(to.path))) { if (whiteListRegex.some((regex) => regex.test(to.path))) {
next() next()
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment