Browse Source

Update user.js

252956 4 years ago
parent
commit
982741b17a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/store/modules/user.js

+ 3 - 3
src/store/modules/user.js

@@ -83,13 +83,13 @@ const user = {
     Logout ({ commit, state }) {
       return new Promise((resolve) => {
         logout(state.token).then(() => {
+          commit('SET_TOKEN', '')
+          commit('SET_ROLES', [])
+          storage.remove(ACCESS_TOKEN)
           resolve()
         }).catch(() => {
           resolve()
         }).finally(() => {
-          commit('SET_TOKEN', '')
-          commit('SET_ROLES', [])
-          storage.remove(ACCESS_TOKEN)
         })
       })
     }