From d8319601ea42d8583f6b944cfcd584ecd48ddd99 Mon Sep 17 00:00:00 2001 From: zhoulingpo Date: Fri, 19 May 2023 14:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9sso=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 6 +++++- src/views/Login.vue | 1 + src/views/checkPage.vue | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 71b2a40..83133e4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,7 +5,11 @@ import login from '../api/modules/login' import { BASE_URL } from '../utils/http' Vue.use(VueRouter) - +const originalPush = VueRouter.prototype.push +VueRouter.prototype.push = function push(location, onResolve, onReject) { + if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) + return originalPush.call(this, location).catch(err => err) +} let routes = [] const requireComponents = require.context('./modules', false, /\.js/) diff --git a/src/views/Login.vue b/src/views/Login.vue index a50abf1..b3f0187 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -127,6 +127,7 @@ export default { this.$store.commit('activeTab', null) this.$store.commit('savePathUrl', null) this.$store.commit('removeDicts', null) + localStorage.removeItem('cookie') // var sevice = "http://"+window.location.host+"/"; // var serviceUrl = encodeURIComponent(sevice); // 正式 diff --git a/src/views/checkPage.vue b/src/views/checkPage.vue index d387164..e9bd0c1 100644 --- a/src/views/checkPage.vue +++ b/src/views/checkPage.vue @@ -49,6 +49,7 @@ export default { this.$store.commit('activeTab', null) this.$store.commit('savePathUrl', null) this.$store.commit('removeDicts', null) + localStorage.removeItem('cookie') // var sevice = "http://"+window.location.host+"/"; // var serviceUrl = encodeURIComponent(sevice); // 正式 @@ -59,6 +60,8 @@ export default { }) return }else{ + localStorage.setItem('cookie',res.data.sessionId) + this.$cookies.get('JSESSIONID') let routeList=menu.map(item=> item.href) let params if(routeList.indexOf('/report/list')>-1){