未验证 提交 b4cdf528 编写于 作者: 花裤衩 提交者: GitHub

fix[logout]: empty tagsview when logout (#2632)

上级 f266713d
......@@ -73,13 +73,18 @@ const actions = {
},
// user logout
logout({ commit, state }) {
logout({ commit, state, dispatch }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
removeToken()
resetRouter()
// reset visited views and cached views
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
dispatch('tagsView/delAllViews', null, { root: true })
resolve()
}).catch(error => {
reject(error)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册