From 23fad30ea6d49fc09323805f4e3a9c03745d1880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=90=AA?= <727393967@qq.com> Date: Mon, 12 Aug 2024 10:01:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/public/Header.vue | 2 ++ src/views/dataTransfer/sampleDataset.vue | 6 +++++- src/views/dataTransfer/voyageReg.vue | 5 +++++ src/views/dicManage/dataSampleType.vue | 5 +++++ src/views/dicManage/docType.vue | 5 +++++ src/views/dicManage/platformType.vue | 5 +++++ src/views/dicManage/sharedUnit.vue | 5 +++++ src/views/dicManage/visitorUnit.vue | 5 +++++ src/views/sysManage/roleManage.vue | 5 +++++ src/views/sysManage/unitManage.vue | 5 +++++ src/views/sysManage/userManage.vue | 5 +++++ 11 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/components/public/Header.vue b/src/components/public/Header.vue index fd2debe..45fa062 100644 --- a/src/components/public/Header.vue +++ b/src/components/public/Header.vue @@ -241,6 +241,7 @@ export default { onLogout() { loginOut().then(res => { location.href = '/login#/container/login' + localStorage.setItem('isLogin', false) }) }, // 获取登录信息 @@ -248,6 +249,7 @@ export default { initInfo().then(res => { Cookies.set('JSESSIONID', res.map.FrameSessionId); this.isLogin = res.login + localStorage.setItem('isLogin', res.login) if (this.isLogin) { this.menuList = this.adminMenu } else { diff --git a/src/views/dataTransfer/sampleDataset.vue b/src/views/dataTransfer/sampleDataset.vue index 67b1c79..7709f76 100644 --- a/src/views/dataTransfer/sampleDataset.vue +++ b/src/views/dataTransfer/sampleDataset.vue @@ -91,7 +91,11 @@ export default { } }, created() { - + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } }, methods: { handleBtn(item) { diff --git a/src/views/dataTransfer/voyageReg.vue b/src/views/dataTransfer/voyageReg.vue index 62d4ad9..6359af9 100644 --- a/src/views/dataTransfer/voyageReg.vue +++ b/src/views/dataTransfer/voyageReg.vue @@ -247,6 +247,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } this.getData() }, methods: { diff --git a/src/views/dicManage/dataSampleType.vue b/src/views/dicManage/dataSampleType.vue index 2a01f1f..1a4ec98 100644 --- a/src/views/dicManage/dataSampleType.vue +++ b/src/views/dicManage/dataSampleType.vue @@ -119,6 +119,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } this.getData() }, methods: { diff --git a/src/views/dicManage/docType.vue b/src/views/dicManage/docType.vue index 496a4d6..f88df17 100644 --- a/src/views/dicManage/docType.vue +++ b/src/views/dicManage/docType.vue @@ -119,6 +119,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } this.getData() }, methods: { diff --git a/src/views/dicManage/platformType.vue b/src/views/dicManage/platformType.vue index c2a407c..45cc606 100644 --- a/src/views/dicManage/platformType.vue +++ b/src/views/dicManage/platformType.vue @@ -119,6 +119,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } this.getData() }, methods: { diff --git a/src/views/dicManage/sharedUnit.vue b/src/views/dicManage/sharedUnit.vue index 4035f53..9a5f8cd 100644 --- a/src/views/dicManage/sharedUnit.vue +++ b/src/views/dicManage/sharedUnit.vue @@ -142,6 +142,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } this.getData() }, methods: { diff --git a/src/views/dicManage/visitorUnit.vue b/src/views/dicManage/visitorUnit.vue index 3b3c317..269defc 100644 --- a/src/views/dicManage/visitorUnit.vue +++ b/src/views/dicManage/visitorUnit.vue @@ -109,6 +109,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } this.getData() }, methods: { diff --git a/src/views/sysManage/roleManage.vue b/src/views/sysManage/roleManage.vue index 511a9f2..6156160 100644 --- a/src/views/sysManage/roleManage.vue +++ b/src/views/sysManage/roleManage.vue @@ -218,6 +218,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } // this.init() }, methods: { diff --git a/src/views/sysManage/unitManage.vue b/src/views/sysManage/unitManage.vue index 7805fc7..66aeb7f 100644 --- a/src/views/sysManage/unitManage.vue +++ b/src/views/sysManage/unitManage.vue @@ -136,6 +136,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } // this.init() }, methods: { diff --git a/src/views/sysManage/userManage.vue b/src/views/sysManage/userManage.vue index 5f343c0..fd45aac 100644 --- a/src/views/sysManage/userManage.vue +++ b/src/views/sysManage/userManage.vue @@ -246,6 +246,11 @@ export default { } }, created() { + const isLogin = localStorage.getItem('isLogin') + if (isLogin == 'false') { + this.$router.push({ name: 'home' }) + return + } // this.init() const arr = [ {