perf: Div 嵌入式切换语言后会整体刷新页面

This commit is contained in:
fit2cloud-chenyw
2025-12-25 14:21:09 +08:00
committed by fit2cloud-chenyw
parent 72d446baff
commit 42aa87f318

View File

@@ -2,7 +2,9 @@ import { defineStore } from 'pinia'
import { store } from '../index'
import { useCache } from '@/hooks/web/useCache'
import { useLocaleStoreWithOut } from './locale'
import { useLocale } from '@/hooks/web/useLocale'
const { wsCache } = useCache()
const { changeLocale } = useLocale()
interface UserState {
token: string
@@ -102,6 +104,7 @@ export const userStore = defineStore('user', {
wsCache.set('user.language', language)
this.language = language
locale.setLang(language)
changeLocale(language as any)
},
clear() {
const keys: string[] = ['token', 'uid', 'name', 'oid', 'language', 'exp', 'time']