This commit is contained in:
qsh
2025-05-16 10:50:53 +08:00
parent ed6da288bc
commit 266aaa312a
7 changed files with 116 additions and 23 deletions

View File

@@ -7,7 +7,7 @@ import { usePageLoading } from '@/hooks/web/usePageLoading'
import { useDictStoreWithOut } from '@/store/modules/dict'
import { useUserStoreWithOut } from '@/store/modules/user'
import { usePermissionStoreWithOut } from '@/store/modules/permission'
import { getTenantId, getAppId } from '@/utils/auth'
import { getAppId } from '@/utils/auth'
import cache from '@/plugins/cache'
const { start, done } = useNProgress()
@@ -26,7 +26,7 @@ router.beforeEach(async (to, from, next) => {
cache?.local?.delete('roleRouters')
cache?.local?.delete('user')
cache?.local?.delete('App_ID')
next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`)
next(`/login`)
} else {
if (getAccessToken()) {
if (to.path === '/login') {
@@ -60,13 +60,13 @@ router.beforeEach(async (to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) {
next()
} else {
const tenantId = getTenantId()
const appId = getAppId()
if (tenantId && appId) {
next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
} else {
next(`/oa/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
}
// const tenantId = getTenantId()
// const appId = getAppId()
// if (tenantId && appId) {
// next(`/oa/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
// } else {
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
// }
}
}
}