mirror of https://github.com/halo-dev/halo-admin
fix: routing loop entry after reinstallation (#558)
Signed-off-by: Ryan Wang <i@ryanc.cc>pull/561/head
parent
a765ad0ab4
commit
d5f1f6ce6d
|
@ -20,6 +20,13 @@ router.beforeEach(async (to, from, next) => {
|
||||||
await store.dispatch('fetchIsInstalled')
|
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') {
|
if (!store.getters.isInstalled && to.name !== 'Install') {
|
||||||
next({
|
next({
|
||||||
name: 'Install'
|
name: 'Install'
|
||||||
|
|
Loading…
Reference in New Issue