Skip to content

Commit b4cdf52

Browse files
authored
fix[logout]: empty tagsview when logout (#2632)
1 parent f266713 commit b4cdf52

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/store/modules/user.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,18 @@ const actions = {
7373
},
7474

7575
// user logout
76-
logout({ commit, state }) {
76+
logout({ commit, state, dispatch }) {
7777
return new Promise((resolve, reject) => {
7878
logout(state.token).then(() => {
7979
commit('SET_TOKEN', '')
8080
commit('SET_ROLES', [])
8181
removeToken()
8282
resetRouter()
83+
84+
// reset visited views and cached views
85+
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
86+
dispatch('tagsView/delAllViews', null, { root: true })
87+
8388
resolve()
8489
}).catch(error => {
8590
reject(error)

0 commit comments

Comments
 (0)