fix: 修复logout清除新主题偏好; 移除DesktopLayout未使用的themeLabels导入
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user