sc
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import router from './router'
|
import router from './router'
|
||||||
import { isRelogin } from '@/config/axios/service'
|
import { isRelogin } from '@/config/axios/service'
|
||||||
import { getAccessToken, removeToken } from '@/utils/auth'
|
import { getAccessToken } from '@/utils/auth'
|
||||||
import { useTitle } from '@/hooks/web/useTitle'
|
import { useTitle } from '@/hooks/web/useTitle'
|
||||||
import { useNProgress } from '@/hooks/web/useNProgress'
|
import { useNProgress } from '@/hooks/web/useNProgress'
|
||||||
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
import { usePageLoading } from '@/hooks/web/usePageLoading'
|
||||||
@@ -9,7 +9,6 @@ import { useUserStoreWithOut } from '@/store/modules/user'
|
|||||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||||
import { useAppStoreWithOut } from '@/store/modules/app'
|
import { useAppStoreWithOut } from '@/store/modules/app'
|
||||||
import { getTenantId, getAppId, setTenantId, setAppId } from '@/utils/auth'
|
import { getTenantId, getAppId, setTenantId, setAppId } from '@/utils/auth'
|
||||||
import cache from '@/plugins/cache'
|
|
||||||
|
|
||||||
const { start, done } = useNProgress()
|
const { start, done } = useNProgress()
|
||||||
|
|
||||||
@@ -21,14 +20,6 @@ const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/regis
|
|||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
start()
|
start()
|
||||||
loadStart()
|
loadStart()
|
||||||
if (getAppId() && to.query?.appId && getAppId() != to.query?.appId) {
|
|
||||||
removeToken()
|
|
||||||
cache?.local?.delete('appInfo')
|
|
||||||
cache?.local?.delete('roleRouters')
|
|
||||||
cache?.local?.delete('user')
|
|
||||||
cache?.local?.delete('App_ID')
|
|
||||||
next(`/login?tenantId=${to.query?.tenantId}&appId=${to.query?.appId}`)
|
|
||||||
} else {
|
|
||||||
if (getAccessToken()) {
|
if (getAccessToken()) {
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
if (to.query?.tenantId && to.query?.appId) {
|
if (to.query?.tenantId && to.query?.appId) {
|
||||||
@@ -75,7 +66,6 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
async function waitTime(seconds) {
|
async function waitTime(seconds) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
async loginOut() {
|
async loginOut() {
|
||||||
await loginOut()
|
await loginOut()
|
||||||
removeToken()
|
removeToken()
|
||||||
cache.local.clear()
|
// cache.local.clear()
|
||||||
this.resetState()
|
this.resetState()
|
||||||
},
|
},
|
||||||
resetState() {
|
resetState() {
|
||||||
|
|||||||
Reference in New Issue
Block a user