Skip to content

Commit

Permalink
修复退出登录后Tab页不清除的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Nov 25, 2024
1 parent 952a148 commit d70e2d5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/store/modules/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ?? '')
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit d70e2d5

Please sign in to comment.