diff --git a/index.html b/index.html index 87e3983..2bd3ce2 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,12 @@ - + 算法测试验证软件平台 -
- +
- - -
- - - {{ userStore.user.username }} -
- -
+ + +
+ + + {{ userStore.user.username }} +
+ +
@@ -54,18 +53,24 @@ import md5 from 'js-md5'; import defaultSettings from "@/settings"; import UserAPI from "@/api/myUser"; import { DeviceEnum } from "@/enums/DeviceEnum"; - +import { ThemeEnum } from "@/enums/ThemeEnum"; const appStore = useAppStore(); const tagsViewStore = useTagsViewStore(); +// Stores const userStore = useUserStore(); -const settingStore = useSettingsStore(); +const settingsStore = useSettingsStore(); const route = useRoute(); const router = useRouter(); const isMobile = computed(() => appStore.device === DeviceEnum.MOBILE); - +const isDark = ref(settingsStore.theme === ThemeEnum.DARK); const { isFullscreen, toggle } = useFullscreen(); +const toggleTheme = () => { + const newTheme = + settingsStore.theme === ThemeEnum.DARK ? ThemeEnum.LIGHT : ThemeEnum.DARK; + settingsStore.changeTheme(newTheme); +}; /** * 注销 @@ -111,33 +116,57 @@ function resetPassword() { } - diff --git a/src/layout/components/NavBar/components/NavbarRight2.vue b/src/layout/components/NavBar/components/NavbarRight2.vue index f1fbb47..8691025 100644 --- a/src/layout/components/NavBar/components/NavbarRight2.vue +++ b/src/layout/components/NavBar/components/NavbarRight2.vue @@ -1,44 +1,44 @@