From a53eb10cdff5588d3b87b0b915ec35aad2a836ef Mon Sep 17 00:00:00 2001 From: Soybean Date: Sun, 17 Nov 2024 22:27:00 +0800 Subject: [PATCH] feat(projects): app version notification plugin support sub deploy path. close #668 --- src/plugins/app.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/app.ts b/src/plugins/app.ts index 7087d219..e59f6160 100644 --- a/src/plugins/app.ts +++ b/src/plugins/app.ts @@ -92,7 +92,9 @@ export function setupAppVersionNotification() { } async function getHtmlBuildTime() { - const res = await fetch(`/index.html?time=${Date.now()}`); + const baseUrl = import.meta.env.VITE_BASE_URL || '/'; + + const res = await fetch(`${baseUrl}index.html?time=${Date.now()}`); const html = await res.text();