mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-15 19:35:07 +08:00
修复用户退出登录时,把 LANG、THEME、LAYOUT、IS_DARK 给清空的问题
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { resetRouter } from '@/router'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import { deleteUserCache } from '@/hooks/web/useCache'
|
||||
import { useLockStore } from '@/store/modules/lock'
|
||||
import { useNow } from '@/hooks/web/useNow'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
@ -10,8 +10,6 @@ import avatarImg from '@/assets/imgs/avatar.gif'
|
||||
|
||||
const tagsViewStore = useTagsViewStore()
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
const { replace } = useRouter()
|
||||
|
||||
const userStore = useUserStore()
|
||||
@ -52,7 +50,7 @@ async function unLock() {
|
||||
async function goLogin() {
|
||||
await userStore.loginOut().catch(() => {})
|
||||
// 登出后清理
|
||||
wsCache.clear()
|
||||
deleteUserCache() // 清空用户缓存
|
||||
tagsViewStore.delAllViews()
|
||||
resetRouter() // 重置静态路由表
|
||||
lockStore.resetLockInfo()
|
||||
|
Reference in New Issue
Block a user