Skip to content

Commit

Permalink
fix: 用户退出后,清除store里的标签记录
Browse files Browse the repository at this point in the history
  • Loading branch information
kanyxmo committed Jan 5, 2024
1 parent 73791fd commit 33b6fac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import tool from '@/utils/tool'
import router from '@/router'
import webRouter from '@/router/webRouter'
import { homePage } from '@/router/homePageRoutes'
import { useAppStore } from '@/store'
import { useAppStore, useTagStore } from '@/store'

const useUserStore = defineStore('user', {

Expand Down Expand Up @@ -85,7 +85,9 @@ const useUserStore = defineStore('user', {

async logout() {
await loginApi.logout()
const tagStore = useTagStore()
tool.local.remove('tags')
tagStore.clearTags()
this.clearToken()
this.resetUserInfo()
},
Expand Down

0 comments on commit 33b6fac

Please sign in to comment.