diff --git a/src/router/guard/permissionGuard.js b/src/router/guard/permissionGuard.js index 73db79331..a99f5db73 100644 --- a/src/router/guard/permissionGuard.js +++ b/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'