Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
fix: routing loop entry after reinstallation (#559)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Wang <i@ryanc.cc>

Co-authored-by: Ryan Wang <i@ryanc.cc>
  • Loading branch information
halo-dev-bot and ruibaby authored May 5, 2022
1 parent 1d9ba73 commit 11044a8
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 11044a8

Please sign in to comment.