fix(仪表板): preview页面链接访问错误

This commit is contained in:
fit2cloud-chenyw 2024-09-12 15:38:38 +08:00
parent a24f1eb7c6
commit 3985adb18d

View File

@ -28,7 +28,7 @@ const embeddedRouteWhiteList = ['/dataset-embedded', '/dataset-form', '/dataset-
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
start() start()
loadStart() loadStart()
checkPlatform() const platform = checkPlatform()
let isDesktop = wsCache.get('app.desktop') let isDesktop = wsCache.get('app.desktop')
if (isDesktop === null) { if (isDesktop === null) {
await appStore.setAppModel() await appStore.setAppModel()
@ -130,7 +130,7 @@ router.beforeEach(async (to, from, next) => {
permissionStore.setCurrentPath(to.path) permissionStore.setCurrentPath(to.path)
next() next()
} else if ( } else if (
embeddedWindowWhiteList.includes(to.path) || (!platform && embeddedWindowWhiteList.includes(to.path)) ||
whiteList.includes(to.path) || whiteList.includes(to.path) ||
to.path.startsWith('/de-link/') to.path.startsWith('/de-link/')
) { ) {
@ -138,7 +138,7 @@ router.beforeEach(async (to, from, next) => {
permissionStore.setCurrentPath(to.path) permissionStore.setCurrentPath(to.path)
next() next()
} else { } else {
next(`/login?redirect=${to.path}`) // 否则全部重定向到登录页 next(`/login?redirect=${to.fullPath || to.path}`) // 否则全部重定向到登录页
} }
} }
}) })