From 1c70e9dbe8a1a02e9c5ba0d589b633cd33c5abd9 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Fri, 14 Jun 2024 14:16:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E8=BF=87=E6=BB=A4=E5=8F=96=E6=9F=A5=E7=9C=8B=E5=B8=A6?= =?UTF-8?q?=E9=80=89=E5=AD=97=E6=AE=B5=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=B1=BB=E5=9E=8B=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/permission.ts | 6 +++--- core/core-frontend/src/permissionMobile.ts | 2 +- core/core-frontend/src/router/index.ts | 7 +++++++ .../src/views/visualized/data/dataset/options.js | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/core/core-frontend/src/permission.ts b/core/core-frontend/src/permission.ts index 5b2fbbca88..402bd50e1c 100644 --- a/core/core-frontend/src/permission.ts +++ b/core/core-frontend/src/permission.ts @@ -22,7 +22,7 @@ const { start, done } = useNProgress() const { loadStart, loadDone } = usePageLoading() -const whiteList = ['/login', '/de-link', '/chart-view'] // 不重定向白名单 +const whiteList = ['/login', '/de-link', '/chart-view', '/notSupport'] // 不重定向白名单 const embeddedWindowWhiteList = ['/dvCanvas', '/dashboard', '/preview', '/dataset-embedded-form'] const embeddedRouteWhiteList = ['/dataset-embedded', '/dataset-form', '/dataset-embedded-form'] router.beforeEach(async (to, from, next) => { @@ -34,13 +34,13 @@ router.beforeEach(async (to, from, next) => { await appStore.setAppModel() isDesktop = appStore.getDesktop } - if (isMobile()) { + if (isMobile() && to.path !== '/notSupport') { done() loadDone() if (to.name === 'link') { window.location.href = window.origin + '/mobile.html#' + to.path } else if (to.path === '/dvCanvas') { - window.location.href = window.origin + '/mobile.html#' + to.path + next('/notSupport') } else if ( wsCache.get('user.token') || isDesktop || diff --git a/core/core-frontend/src/permissionMobile.ts b/core/core-frontend/src/permissionMobile.ts index 3e2b3c5943..7affd4ecd0 100644 --- a/core/core-frontend/src/permissionMobile.ts +++ b/core/core-frontend/src/permissionMobile.ts @@ -39,7 +39,7 @@ router.beforeEach(async (to, _, next) => { next() } } else { - if (whiteList.includes(to.path) || to.path.includes('/de-link')) { + if (whiteList.includes(to.path) || to.name === 'link') { next() } else { next('/login') // 否则全部重定向到登录页 diff --git a/core/core-frontend/src/router/index.ts b/core/core-frontend/src/router/index.ts index 0428ac6371..006703bae7 100644 --- a/core/core-frontend/src/router/index.ts +++ b/core/core-frontend/src/router/index.ts @@ -20,6 +20,13 @@ export const routes: AppRouteRecordRaw[] = [ } ] }, + { + path: '/notSupport', + name: 'notSupport', + hidden: true, + meta: {}, + component: () => import('@/views/mobile/panel/NotSupport.vue') + }, { path: '/login', name: 'login', diff --git a/core/core-frontend/src/views/visualized/data/dataset/options.js b/core/core-frontend/src/views/visualized/data/dataset/options.js index 7f0cb017e2..34707116fa 100644 --- a/core/core-frontend/src/views/visualized/data/dataset/options.js +++ b/core/core-frontend/src/views/visualized/data/dataset/options.js @@ -26,7 +26,7 @@ const sysParamsIlns = sysParamsEnum.map(_ => { return { value: `\${sysParams.${_}}`, label: `auth.sysParams_type.${toLine(_)}` } }) -const fieldEnums = ['text', 'time', 'value', 'value', , 'location'] +const fieldEnums = ['text', 'time', 'value', 'value', 'value', 'location'] export { textOptions,