fix: 修复退出登录后Tab页不清除的问题 (#46)

Co-authored-by: Hooray <304327508@qq.com>
This commit is contained in:
ResJI 2024-11-25 18:23:30 +08:00 committed by GitHub
parent d40c42a810
commit 88900d6ed3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@ import router from '@/router'
import useMenuStore from './menu'
import useRouteStore from './route'
import useSettingsStore from './settings'
import useTabbarStore from './tabbar'
const useUserStore = defineStore(
// 唯一ID
@ -11,6 +12,7 @@ const useUserStore = defineStore(
const settingsStore = useSettingsStore()
const routeStore = useRouteStore()
const menuStore = useMenuStore()
const tabbarStore = useTabbarStore()
const account = ref(localStorage.account ?? '')
const token = ref(localStorage.token ?? '')
@ -47,6 +49,7 @@ const useUserStore = defineStore(
permissions.value = []
routeStore.removeRoutes()
menuStore.setActived(0)
settingsStore.settings.tabbar.enable && tabbarStore.clean()
router.push({
name: 'login',
query: {