Skip to content

Commit

Permalink
Merge pull request #1 from mtraders/master
Browse files Browse the repository at this point in the history
fix: routing loop entry after reinstallation (halo-dev#558)
  • Loading branch information
LiZhenchong authored May 5, 2022
2 parents a765ad0 + d5f1f6c commit c913e09
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/router/guard/permissionGuard.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('fetchIsInstalled')
}

// if it is not installed, empty the dirty data
if (!store.getters.isInstalled) {
await store.commit('SET_OPTIONS', undefined)
await store.commit('CLEAR_TOKEN')
await store.commit('SET_USER', {})
}

if (!store.getters.isInstalled && to.name !== 'Install') {
next({
name: 'Install'
Expand Down

0 comments on commit c913e09

Please sign in to comment.