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

Commit 2b557a0

Browse files
committed
feat(routes): reset all dynamic routes when user log out
1 parent 684ad8e commit 2b557a0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/store/modules/login/actions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ export default {
3131
commit(types.SET_ACCESS_TOKEN, '')
3232
commit(types.SET_DYNAMIC_ROUTES, [])
3333
commit(types.SET_ALL_ROUTES, [])
34+
// https://github.com/PanJiaChen/vue-element-admin/issues/416
35+
// location.reload() is used to reset all dynamic routes.
36+
// All routes records should be synced with vuex-persistedstate.
37+
location.reload()
3438
},
3539
fetchUserAccess ({ commit }, username) {
3640
return fetchUserAccess({ username })

0 commit comments

Comments
 (0)