From db6242145429da48fcefec5aae1540e1278ffae8 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 23 Nov 2023 13:28:24 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E9=A3=9E=E4=B9=A6=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/utils/utils.ts | 13 +++++++++++++ core/core-frontend/src/views/login/index.vue | 3 ++- de-xpack | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/utils/utils.ts b/core/core-frontend/src/utils/utils.ts index 778b74fa2c..cc509b1e22 100644 --- a/core/core-frontend/src/utils/utils.ts +++ b/core/core-frontend/src/utils/utils.ts @@ -67,3 +67,16 @@ export const setColorName = (obj, keyword: string, key?: string, colorKey?: stri } obj[colorKey] = null } + +export const getQueryString = (name: string) => { + const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i') + const r = window.location.search.substr(1).match(reg) + if (r != null) { + return unescape(r[2]) + } + return null +} + +export const isLarkPlatform = () => { + return !!getQueryString('state') && !!getQueryString('code') +} diff --git a/core/core-frontend/src/views/login/index.vue b/core/core-frontend/src/views/login/index.vue index 18666d192d..e9d176490d 100644 --- a/core/core-frontend/src/views/login/index.vue +++ b/core/core-frontend/src/views/login/index.vue @@ -16,6 +16,7 @@ import { logoutHandler } from '@/utils/logout' import DeImage from '@/assets/login-desc-de.png' import elementResizeDetectorMaker from 'element-resize-detector' import PreheatImage from '@/assets/preheat.png' +import { isLarkPlatform } from '@/utils/utils' const { wsCache } = useCache() const appStore = useAppStoreWithOut() const userStore = useUserStoreWithOut() @@ -129,7 +130,7 @@ const showLoginImage = computed(() => { const checkPlatform = () => { const flagArray = ['/casbi', 'oidcbi'] const pathname = window.location.pathname - if (!flagArray.some(flag => pathname.includes(flag))) { + if (!flagArray.some(flag => pathname.includes(flag)) && !isLarkPlatform()) { cleanPlatformFlag() } } diff --git a/de-xpack b/de-xpack index 91e4019972..723bb9ff96 160000 --- a/de-xpack +++ b/de-xpack @@ -1 +1 @@ -Subproject commit 91e4019972ec96f7f672bb5da2156f54ca9d72ea +Subproject commit 723bb9ff960159769673ac58982f07b18e6aa181