feat: 前端支持平台子路径,托管时从平台登录进入

This commit is contained in:
2026-11-03 12:30:24 +08:00
parent c38e649904
commit 5d4b86c558
17 changed files with 271 additions and 53 deletions
+7 -1
View File
@@ -2,8 +2,14 @@ import { computed, ref } from "vue";
export type ThemeChoice = "system" | "dark" | "light";
const STORAGE_KEY = "decom-theme";
const STORAGE_KEY = "decomeval.theme";
const LEGACY_KEY = "decom-theme";
const media = window.matchMedia("(prefers-color-scheme: dark)");
const legacy = localStorage.getItem(LEGACY_KEY);
if (legacy !== null) {
if (localStorage.getItem(STORAGE_KEY) === null) localStorage.setItem(STORAGE_KEY, legacy);
localStorage.removeItem(LEGACY_KEY);
}
const stored = localStorage.getItem(STORAGE_KEY);
export const themeChoice = ref<ThemeChoice>(stored === "dark" || stored === "light" || stored === "system" ? stored : "system");
const systemDark = ref(media.matches);