Skip to content
This repository was archived by the owner on May 12, 2020. It is now read-only.

Commit a7f0893

Browse files
committed
fix(login): Should remove use info when use logout
1 parent af1fa76 commit a7f0893

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/store/modules/login/actions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default {
3434
},
3535
userLogout({ dispatch }) {
3636
dispatch('resetStore', null, { root: true })
37+
localStorage.clear()
3738
// https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
3839
// remove all routes which was added by router.addRoutes()
3940
resetRouter()

src/utils/storage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const TOKEN_KEY = '$_tk'
2-
const USER_INFO_KEY = '$_usi'
1+
const TOKEN_KEY = '$_ut'
2+
const USER_INFO_KEY = '$_ui'
33
const STATE_SNAPSHOT = '$_snapshot'
44

55
function setValueToLocal(key, val, storage) {

0 commit comments

Comments
 (0)