更新前端src目录文件
This commit is contained in:
parent
d3219974e5
commit
487c3fd535
@ -48,7 +48,16 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
linkQuery = '?' + tempQuery
|
linkQuery = '?' + tempQuery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
window.location.href = window.origin + '/mobile.html#' + to.path + linkQuery
|
let pathname = window.location.pathname
|
||||||
|
pathname = pathname.replace('casbi/', '')
|
||||||
|
pathname = pathname.replace('oidc/', '')
|
||||||
|
pathname = pathname.substring(0, pathname.length - 1)
|
||||||
|
const prefix = window.origin + pathname
|
||||||
|
let toPath = to.fullPath
|
||||||
|
if (toPath.includes('?')) {
|
||||||
|
toPath = to.fullPath.substring(0, to.fullPath.lastIndexOf('?'))
|
||||||
|
}
|
||||||
|
window.location.href = prefix + '/mobile.html#' + toPath + linkQuery
|
||||||
} else if (
|
} else if (
|
||||||
wsCache.get('user.token') ||
|
wsCache.get('user.token') ||
|
||||||
isDesktop ||
|
isDesktop ||
|
||||||
|
@ -7,11 +7,13 @@ import { getRoleRouters } from '@/api/common'
|
|||||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||||
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
import { interactiveStoreWithOut } from '@/store/modules/interactive'
|
||||||
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
import { useAppearanceStoreWithOut } from '@/store/modules/appearance'
|
||||||
|
import { useLinkStoreWithOut } from '@/store/modules/link'
|
||||||
|
|
||||||
const appearanceStore = useAppearanceStoreWithOut()
|
const appearanceStore = useAppearanceStoreWithOut()
|
||||||
const permissionStore = usePermissionStoreWithOut()
|
const permissionStore = usePermissionStoreWithOut()
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
const userStore = useUserStoreWithOut()
|
const userStore = useUserStoreWithOut()
|
||||||
|
const linkStore = useLinkStoreWithOut()
|
||||||
|
|
||||||
const { start, done } = useNProgress()
|
const { start, done } = useNProgress()
|
||||||
const interactiveStore = interactiveStoreWithOut()
|
const interactiveStore = interactiveStoreWithOut()
|
||||||
@ -26,6 +28,7 @@ router.beforeEach(async (to, _, next) => {
|
|||||||
if (to.name === 'link') {
|
if (to.name === 'link') {
|
||||||
next()
|
next()
|
||||||
} else if (wsCache.get('user.token')) {
|
} else if (wsCache.get('user.token')) {
|
||||||
|
linkStore.setLinkToken('')
|
||||||
if (!userStore.getUid) {
|
if (!userStore.getUid) {
|
||||||
await userStore.setUser()
|
await userStore.setUser()
|
||||||
}
|
}
|
||||||
@ -44,6 +47,7 @@ router.beforeEach(async (to, _, next) => {
|
|||||||
if (whiteList.includes(to.path) || to.name === 'link') {
|
if (whiteList.includes(to.path) || to.name === 'link') {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
|
linkStore.setLinkToken('')
|
||||||
next('/login') // 否则全部重定向到登录页
|
next('/login') // 否则全部重定向到登录页
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user