Browse Source

fix: routing loop entry after reinstallation (#558)

Signed-off-by: Ryan Wang <i@ryanc.cc>
pull/561/head
Ryan Wang 3 years ago committed by GitHub
parent
commit
d5f1f6ce6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/router/guard/permissionGuard.js

7
src/router/guard/permissionGuard.js

@ -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'

Loading…
Cancel
Save