From 545077ea2943711882c25a0e2011f390e84b31cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Wed, 10 Apr 2024 17:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=94=9F=E4=BA=A7=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hw-ui/src/permission.js | 4 ++++ hw-ui/src/store/getters.js | 1 + hw-ui/src/views/board/fifthFloor/index.vue | 14 +++++++++++++- hw-ui/src/views/board/firstFloor/index.vue | 14 +++++++++++++- hw-ui/src/views/board/fourthFloor/assemble.vue | 14 +++++++++++++- hw-ui/src/views/board/fourthFloor/laserLight.vue | 14 +++++++++++++- hw-ui/src/views/board/fourthFloor/weld.vue | 14 +++++++++++++- 7 files changed, 70 insertions(+), 5 deletions(-) diff --git a/hw-ui/src/permission.js b/hw-ui/src/permission.js index 459ce6d..9129646 100644 --- a/hw-ui/src/permission.js +++ b/hw-ui/src/permission.js @@ -13,6 +13,10 @@ const whiteList = ['/login', '/login2', '/register'] router.beforeEach((to, from, next) => { NProgress.start() if (getToken()) { + let floorData = JSON.parse(sessionStorage.getItem('FLOORDATA') || '{}') + if(floorData?.route && to.fullPath !== floorData?.route){ + next({ path: floorData?.route }) + } to.meta.title && store.dispatch('settings/setTitle', to.meta.title) /* has token*/ if (to.path === '/login') { diff --git a/hw-ui/src/store/getters.js b/hw-ui/src/store/getters.js index 8adb1b6..59b3e9b 100644 --- a/hw-ui/src/store/getters.js +++ b/hw-ui/src/store/getters.js @@ -11,6 +11,7 @@ const getters = { introduction: state => state.user.introduction, roles: state => state.user.roles, permissions: state => state.user.permissions, + floorData: state => state.user.floorData, permission_routes: state => state.permission.routes, topbarRouters:state => state.permission.topbarRouters, defaultRoutes:state => state.permission.defaultRoutes, diff --git a/hw-ui/src/views/board/fifthFloor/index.vue b/hw-ui/src/views/board/fifthFloor/index.vue index 1b82f70..257c48a 100644 --- a/hw-ui/src/views/board/fifthFloor/index.vue +++ b/hw-ui/src/views/board/fifthFloor/index.vue @@ -188,7 +188,7 @@ 首页 SOP预览 - 退出 + 退出 @@ -578,6 +578,18 @@ export default { }) }, methods: { + + async logout() { + this.$confirm('确定注销并退出系统吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + location.href = '/login?isStationId=true'; + }) + }).catch(() => {}); + }, next1() { this.nowNum1 += 1 getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { diff --git a/hw-ui/src/views/board/firstFloor/index.vue b/hw-ui/src/views/board/firstFloor/index.vue index 60b48e8..e229a2f 100644 --- a/hw-ui/src/views/board/firstFloor/index.vue +++ b/hw-ui/src/views/board/firstFloor/index.vue @@ -371,7 +371,7 @@ 首页 SOP预览 最小化 - 退出 + 退出 @@ -684,6 +684,18 @@ export default { }) }, methods: { + + async logout() { + this.$confirm('确定注销并退出系统吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + location.href = '/login?isStationId=true'; + }) + }).catch(() => {}); + }, next1() { this.nowNum1 += 1 getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { diff --git a/hw-ui/src/views/board/fourthFloor/assemble.vue b/hw-ui/src/views/board/fourthFloor/assemble.vue index c86ef2c..a897539 100644 --- a/hw-ui/src/views/board/fourthFloor/assemble.vue +++ b/hw-ui/src/views/board/fourthFloor/assemble.vue @@ -209,7 +209,7 @@ 首页 键盘 最小化 - 退出 + 退出 @@ -520,6 +520,18 @@ export default { }) }, methods: { + + async logout() { + this.$confirm('确定注销并退出系统吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + location.href = '/login?isStationId=true'; + }) + }).catch(() => {}); + }, next1() { this.nowNum1 += 1 getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { diff --git a/hw-ui/src/views/board/fourthFloor/laserLight.vue b/hw-ui/src/views/board/fourthFloor/laserLight.vue index 2e6e11b..fcf4aef 100644 --- a/hw-ui/src/views/board/fourthFloor/laserLight.vue +++ b/hw-ui/src/views/board/fourthFloor/laserLight.vue @@ -188,7 +188,7 @@ 首页 板材入库 SOP预览 - 退出 + 退出 @@ -450,6 +450,18 @@ export default { }) }, methods: { + + async logout() { + this.$confirm('确定注销并退出系统吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + location.href = '/login?isStationId=true'; + }) + }).catch(() => {}); + }, next1() { this.nowNum1 += 1 getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => { diff --git a/hw-ui/src/views/board/fourthFloor/weld.vue b/hw-ui/src/views/board/fourthFloor/weld.vue index ab0cd8c..7dde0e6 100644 --- a/hw-ui/src/views/board/fourthFloor/weld.vue +++ b/hw-ui/src/views/board/fourthFloor/weld.vue @@ -158,7 +158,7 @@ 首页 SOP预览 - 退出 + 退出 @@ -372,6 +372,18 @@ export default { }) }, methods: { + + async logout() { + this.$confirm('确定注销并退出系统吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + location.href = '/login?isStationId=true'; + }) + }).catch(() => {}); + }, next1() { this.nowNum1 += 1 getProductPlans({pageNum: this.nowNum1, pageSize: 5}).then(e => {