From 4560a5bda2e9a3ad29b861c2d3c09687cfc61950 Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Fri, 15 Mar 2024 17:29:53 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=B5=8C=E5=85=A5=E5=BC=8F):=20=E5=B5=8C?= =?UTF-8?q?=E5=85=A5=E5=BC=8F=E4=BA=8C=E7=BA=A7=E8=B7=AF=E5=BE=84=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/pages/panel/main.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/core-frontend/src/pages/panel/main.ts b/core/core-frontend/src/pages/panel/main.ts index 1b34b5747e..9ee646d83a 100644 --- a/core/core-frontend/src/pages/panel/main.ts +++ b/core/core-frontend/src/pages/panel/main.ts @@ -13,8 +13,7 @@ const formatterUrl = (node: T, prefix: string) => { } if (url.includes(suffix) || url.includes('dataease-private')) { - const { origin, pathname } = new URL(url) - const currentUrlprefix = `${origin}${pathname.slice(0, pathname.length - 1)}` + const currentUrlprefix = new URL(url).origin const newUrl = url.replace(currentUrlprefix, prefix) if (node instanceof HTMLLinkElement) { node.href = newUrl @@ -37,7 +36,8 @@ const getPrefix = (): string => { url = ele.src } if (url.includes(suffix)) { - prefix = new URL(url).origin + const { origin, pathname } = new URL(url) + prefix = `${origin}${pathname.slice(0, pathname.length - 1)}` return true } }