From 5b550295765f84014b1f776b9f1f108584bab0a1 Mon Sep 17 00:00:00 2001 From: v6ole Date: Mon, 13 Jul 2026 01:51:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dlogout=E6=B8=85?= =?UTF-8?q?=E9=99=A4=E6=96=B0=E4=B8=BB=E9=A2=98=E5=81=8F=E5=A5=BD;=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4DesktopLayout=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84themeLabels=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude --- frontend/src/components/DesktopLayout.vue | 2 +- frontend/src/stores/auth.ts | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) 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) {