💥🐛 自动兼容的v0判定逻辑有误,导致未加载v0的全量配置

This commit is contained in:
hi2hi 2024-12-10 08:51:55 +00:00
parent 4502683cd5
commit c371755149
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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,