support sub path

This commit is contained in:
MaysWind
2025-03-04 23:39:16 +08:00
parent e83b959930
commit 872639fefa
4 changed files with 24 additions and 11 deletions
+6 -4
View File
@@ -1,3 +1,5 @@
import { getBasePath } from './web.ts';
export function isProduction(): boolean {
return __EZBOOKKEEPING_IS_PRODUCTION__;
}
@@ -28,15 +30,15 @@ export function getBuildTime(): string {
export function getMobileVersionPath(): string {
if (isProduction()) {
return '../mobile';
return getBasePath() + '/mobile#/';
} else {
return 'mobile.html';
return getBasePath() + '/mobile.html#/';
}
}
export function getDesktopVersionPath(): string {
if (isProduction()) {
return '../desktop';
return getBasePath() + '/desktop#/';
} else {
return 'desktop.html';
return getBasePath() + '/desktop.html#/';
}
}