From aea50162d97e72fb700fd47601db771e2032e587 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Thu, 3 Apr 2025 12:37:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E4=BF=9D=E5=AD=98=E5=90=8E=E6=B5=8F=E8=A7=88?= =?UTF-8?q?=E5=99=A8url=E6=9C=AA=E5=8F=98=E5=8C=96=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=88=B7=E6=96=B0=E4=BC=9A=E5=A4=B1=E6=95=88=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/components/dashboard/DbToolbar.vue | 2 +- .../src/components/data-visualization/DvToolbar.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/components/dashboard/DbToolbar.vue b/core/core-frontend/src/components/dashboard/DbToolbar.vue index aae59b4acb..b283acb959 100644 --- a/core/core-frontend/src/components/dashboard/DbToolbar.vue +++ b/core/core-frontend/src/components/dashboard/DbToolbar.vue @@ -263,7 +263,7 @@ const saveResource = (checkParams?) => { canvasSave(() => { snapshotStore.resetStyleChangeTimes() let url = window.location.href - url = url.replace(/\?opt=create/, `?resourceId=${dvInfo.value.id}`) + url = url.replace(/(#\/[^?]*)(?:\?[^#]*)?/, `$1?resourceId=${dvInfo.value.id}`) if (!embeddedStore.baseUrl) { window.history.replaceState( { diff --git a/core/core-frontend/src/components/data-visualization/DvToolbar.vue b/core/core-frontend/src/components/data-visualization/DvToolbar.vue index 2edcde87e8..0e1355e24a 100644 --- a/core/core-frontend/src/components/data-visualization/DvToolbar.vue +++ b/core/core-frontend/src/components/data-visualization/DvToolbar.vue @@ -31,6 +31,7 @@ import DeResourceGroupOpt from '@/views/common/DeResourceGroupOpt.vue' import { canvasSave, checkCanvasChangePre, + cleanUrlAndSetDvId, findAllViewsId, initCanvasData } from '@/utils/canvasUtils' @@ -181,7 +182,7 @@ const saveResource = (checkParams?) => { snapshotStore.resetStyleChangeTimes() wsCache.delete('DE-DV-CATCH-' + dvInfo.value.id) let url = window.location.href - url = url.replace(/\?opt=create/, `?dvId=${dvInfo.value.id}`) + url = url.replace(/(#\/[^?]*)(?:\?[^#]*)?/, `$1?dvId=${dvInfo.value.id}`) if (!embeddedStore.baseUrl) { window.history.replaceState( {