diff --git a/hw-ui/src/store/modules/user.js b/hw-ui/src/store/modules/user.js index 7cee4166..96dde7d2 100644 --- a/hw-ui/src/store/modules/user.js +++ b/hw-ui/src/store/modules/user.js @@ -8,7 +8,7 @@ const user = { name: '', avatar: '', roles: [], - permissions: [] + permissions: [], }, mutations: { @@ -32,7 +32,7 @@ const user = { }, SET_PERMISSIONS: (state, permissions) => { state.permissions = permissions - } + }, }, actions: { @@ -100,6 +100,7 @@ const user = { commit('SET_TOKEN', '') commit('SET_ROLES', []) commit('SET_PERMISSIONS', []) + sessionStorage.removeItem('FLOORDATA') removeToken() resolve() }).catch(error => { @@ -115,7 +116,8 @@ const user = { removeToken() resolve() }) - } + }, + } } diff --git a/hw-ui/src/views/login.vue b/hw-ui/src/views/login.vue index 407a1436..f7dbe6d1 100644 --- a/hw-ui/src/views/login.vue +++ b/hw-ui/src/views/login.vue @@ -201,6 +201,9 @@ export default { this.$store.dispatch("Login", this.loginForm).then(() => { let data = this.options.find(v=>v.stationId === this.loginForm.stationId) || {} let routeData = this.floorData.find(v=>v.floor === data.floor && v.processId === data.processId) || {} + if(routeData.route){ + sessionStorage.setItem("FLOORDATA", JSON.stringify(routeData)) + } // this.$router.push({path: this.redirect || "/"}).catch(() => { // }); this.$router.push({path: routeData.route || this.redirect || "/"}).catch(() => {