feat: 实现已确认的登录、采集和任务导出

This commit is contained in:
2026-10-29 18:11:15 +08:00
parent af91488934
commit 7ed299bbf6
44 changed files with 4546 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
import { computed, ref } from "vue";
export type ThemeChoice = "system" | "dark" | "light";
const STORAGE_KEY = "decom-theme";
const media = window.matchMedia("(prefers-color-scheme: dark)");
const stored = localStorage.getItem(STORAGE_KEY);
export const themeChoice = ref<ThemeChoice>(stored === "dark" || stored === "light" || stored === "system" ? stored : "system");
const systemDark = ref(media.matches);
media.addEventListener("change", () => {
systemDark.value = media.matches;
});
export const isDark = computed(() => {
if (themeChoice.value === "dark") return true;
if (themeChoice.value === "light") return false;
return systemDark.value;
});
export function setThemeChoice(choice: ThemeChoice) {
themeChoice.value = choice;
localStorage.setItem(STORAGE_KEY, choice);
}