diff --git a/frontend/src/components/DesktopLayout.vue b/frontend/src/components/DesktopLayout.vue index 071e965..99fa320 100644 --- a/frontend/src/components/DesktopLayout.vue +++ b/frontend/src/components/DesktopLayout.vue @@ -2,7 +2,7 @@ import { useRoute, useRouter } from 'vue-router' import { computed, ref } from 'vue' import { useAuthStore } from '@/stores/auth' -import { useThemeStore, themeLabels } from '@/stores/theme' +import { useThemeStore } from '@/stores/theme' const route = useRoute() const router = useRouter() diff --git a/frontend/src/stores/auth.ts b/frontend/src/stores/auth.ts index 49a6e09..4ea54d4 100644 --- a/frontend/src/stores/auth.ts +++ b/frontend/src/stores/auth.ts @@ -29,10 +29,14 @@ export const useAuthStore = defineStore('auth', () => { userId.value = '' name.value = '' role.value = '' - // Preserve theme preference across logout - const savedTheme = localStorage.getItem('theme') + // Preserve theme preferences across logout + const savedMode = localStorage.getItem('theme-mode') + const savedLight = localStorage.getItem('theme-light') + const savedDark = localStorage.getItem('theme-dark') localStorage.clear() - if (savedTheme) localStorage.setItem('theme', savedTheme) + if (savedMode) localStorage.setItem('theme-mode', savedMode) + if (savedLight) localStorage.setItem('theme-light', savedLight) + if (savedDark) localStorage.setItem('theme-dark', savedDark) } async function casdoorLogin(code: string, state: string) {