From c3717551497fe06ef5588276df253beff8b5857f Mon Sep 17 00:00:00 2001 From: hi2hi Date: Tue, 10 Dec 2024 08:51:55 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=F0=9F=90=9B=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E7=9A=84v0=E5=88=A4=E5=AE=9A=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=9C=89=E8=AF=AF=EF=BC=8C=E5=AF=BC=E8=87=B4=E6=9C=AA?= =?UTF-8?q?=E5=8A=A0=E8=BD=BDv0=E7=9A=84=E5=85=A8=E9=87=8F=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/load-nezha-v0-config.js | 2 +- vite.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/load-nezha-v0-config.js b/src/utils/load-nezha-v0-config.js index 036c8f8..f1d0e39 100644 --- a/src/utils/load-nezha-v0-config.js +++ b/src/utils/load-nezha-v0-config.js @@ -6,7 +6,7 @@ function getNezhaConfigUrl() { return nezhaPath; } const a = document.createElement('a'); - if (nezhaPath === '/nezha/' && import.meta.env.VITE_BASE_PATH !== '/') { + if (nezhaPath === '/nezha/' && (import.meta.env.VITE_BASE_PATH && import.meta.env.VITE_BASE_PATH !== '/')) { [a.href] = window.location.href.split(import.meta.env.VITE_BASE_PATH); } else { a.href = nezhaPath; diff --git a/vite.config.js b/vite.config.js index e5f9eb9..a95b5a3 100644 --- a/vite.config.js +++ b/vite.config.js @@ -42,7 +42,7 @@ if (process.env.NODE_ENV === 'development') { }, }; - if (process.env.VITE_BASE_PATH === '/') { + if (process.env.VITE_BASE_PATH === '/' || !process.env.VITE_BASE_PATH) { proxy['/nezha/'] = { target: process.env.NEZHA_HOST, changeOrigin: true,