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 } }