We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f266713 commit b4cdf52Copy full SHA for b4cdf52
src/store/modules/user.js
@@ -73,13 +73,18 @@ const actions = {
73
},
74
75
// user logout
76
- logout({ commit, state }) {
+ logout({ commit, state, dispatch }) {
77
return new Promise((resolve, reject) => {
78
logout(state.token).then(() => {
79
commit('SET_TOKEN', '')
80
commit('SET_ROLES', [])
81
removeToken()
82
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
88
resolve()
89
}).catch(error => {
90
reject(error)
0 commit comments