From 0d67a75444d667fafdf3c647fc7150dc8cfb40bf Mon Sep 17 00:00:00 2001 From: "1054959069@qq.com" <1054959069@qq.com> Date: Fri, 15 Nov 2024 14:17:29 +0800 Subject: [PATCH] fix(projects): fix app version notification plugin with sub deploy path --- src/plugins/app.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/app.ts b/src/plugins/app.ts index f2080ef7..b84f37ac 100644 --- a/src/plugins/app.ts +++ b/src/plugins/app.ts @@ -64,7 +64,8 @@ export function setupAppVersionNotification() { } async function getHtmlBuildTime() { - const res = await fetch(`/index.html?time=${Date.now()}`); + const baseUrl = import.meta.env.VITE_BASE_URL === '/' ? '' : import.meta.env.VITE_BASE_URL + const res = await fetch(`${baseUrl}/index.html?time=${Date.now()}`); const html = await res.text();