From 90612929696ea65d580131d5e7de2326e37535d6 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 9 Apr 2025 17:51:28 +0800 Subject: [PATCH] =?UTF-8?q?perf(X-Pack):=20=E5=B5=8C=E5=85=A5=E5=BC=8F=20T?= =?UTF-8?q?oken=20=E5=8F=82=E6=95=B0=E4=BD=9C=E7=94=A8=E4=BA=8E=E8=A7=86?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/pages/panel/ViewWrapper.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/core-frontend/src/pages/panel/ViewWrapper.vue b/core/core-frontend/src/pages/panel/ViewWrapper.vue index 46c83c0066..2b355f3ff8 100644 --- a/core/core-frontend/src/pages/panel/ViewWrapper.vue +++ b/core/core-frontend/src/pages/panel/ViewWrapper.vue @@ -11,6 +11,7 @@ import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain' import { useI18n } from '@/hooks/web/useI18n' import { XpackComponent } from '@/components/plugin' import EmptyBackground from '../../components/empty-background/src/EmptyBackground.vue' +import exeRequest from '@/config/axios' const { wsCache } = useCache() const interactiveStore = interactiveStoreWithOut() const embeddedStore = useEmbedded() @@ -69,6 +70,13 @@ onBeforeMount(async () => { state.suffixId = embeddedParams.suffixId || 'common' window.addEventListener('message', winMsgHandle) + let tokenInfo = null + if (embeddedStore.getToken && !Object.keys((tokenInfo = embeddedStore.getTokenInfo)).length) { + const res = await exeRequest.get({ url: '/embedded/getTokenArgs' }) + embeddedStore.setTokenInfo(res.data) + tokenInfo = embeddedStore.getTokenInfo + } + // 添加外部参数 let attachParams await getOuterParamsInfo(embeddedParams.dvId).then(rsp => { @@ -87,6 +95,9 @@ onBeforeMount(async () => { return } } + if (tokenInfo && Object.keys(tokenInfo).length) { + attachParams = Object.assign({}, attachParams, tokenInfo) + } const chartId = embeddedParams?.chartId initCanvasData(