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){