From 0582a3e9b61c98855c095b26466310956337aa0c Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 13 May 2025 16:36:07 +0800 Subject: [PATCH] chore: use gloabe --- web/config/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/config/index.ts b/web/config/index.ts index 08cc27a42b..4d308807c5 100644 --- a/web/config/index.ts +++ b/web/config/index.ts @@ -27,9 +27,9 @@ else if ( ) { // Not build can not get env from process.env.NEXT_PUBLIC_ in browser https://nextjs.org/docs/basic-features/environment-variables#exposing-environment-variables-to-the-browser apiPrefix = globalThis.document.body.getAttribute('data-api-prefix') as string - webPrefix = (globalThis.document.body.getAttribute('data-web-prefix') as string || location.origin) + webPrefix = (globalThis.document.body.getAttribute('data-web-prefix') as string || globalThis.location.origin) publicApiPrefix = globalThis.document.body.getAttribute('data-pubic-api-prefix') as string - publicWebPrefix = (globalThis.document.body.getAttribute('data-pubic-web-prefix') as string || location.origin) + publicWebPrefix = (globalThis.document.body.getAttribute('data-pubic-web-prefix') as string || globalThis.location.origin) } else { // const domainParts = globalThis.location?.host?.split('.');