From e00fdd21911889289bb5f3afe7b5d29898d9ce78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E9=B8=BF=E5=AE=87?= Date: Mon, 12 May 2025 11:29:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=90=8E=E7=AB=AFURL=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E6=9C=AA=E5=AE=9A=E4=B9=89=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=97=B6=E8=BF=94=E5=9B=9E=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=E8=80=8C=E4=B8=8D=E6=98=AF=20undefined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史鸿宇 --- src/utils/tools.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/tools.ts b/src/utils/tools.ts index 8ca8914..78f3fb3 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -96,5 +96,7 @@ export async function getBaseProxyUrl(): Promise { if (window.location.hostname === 'localhost') { return ''; } - return import.meta.env.VITE_BASE_PROXY_URL; + // VITE_BASE_PROXY_URL 未定义时返回空字符串 + const viteProxyUrl = import.meta.env.VITE_BASE_PROXY_URL; + return typeof viteProxyUrl === 'string' && viteProxyUrl ? viteProxyUrl : ''; } -- Gitee