|
@@ -60,7 +60,7 @@ if(requestInterceptor === undefined){ |
|
|
|
|
|
|
|
|
// 响应拦截器 |
|
|
// 响应拦截器 |
|
|
let responseInterceptor; |
|
|
let responseInterceptor; |
|
|
let gqnum = 0; |
|
|
|
|
|
|
|
|
// let gqnum = 0; |
|
|
if(responseInterceptor === undefined){ |
|
|
if(responseInterceptor === undefined){ |
|
|
responseInterceptor = service.interceptors.response.use(res => { |
|
|
responseInterceptor = service.interceptors.response.use(res => { |
|
|
Toast.clear(); |
|
|
Toast.clear(); |
|
@@ -68,9 +68,9 @@ if(responseInterceptor === undefined){ |
|
|
const code = res.data.code || 200; |
|
|
const code = res.data.code || 200; |
|
|
// 获取错误信息 |
|
|
// 获取错误信息 |
|
|
const msg = errorCode[code] || res.data.msg || errorCode['default'] |
|
|
const msg = errorCode[code] || res.data.msg || errorCode['default'] |
|
|
console.info(gqnum); |
|
|
|
|
|
if (code === 401 && gqnum === 0) { |
|
|
|
|
|
gqnum++; |
|
|
|
|
|
|
|
|
// console.info(gqnum); && gqnum === 0 |
|
|
|
|
|
if (code === 401) { |
|
|
|
|
|
// gqnum++; |
|
|
Dialog.confirm({ |
|
|
Dialog.confirm({ |
|
|
title: '系统提示', |
|
|
title: '系统提示', |
|
|
message: '登录状态已过期,请重新登录', |
|
|
message: '登录状态已过期,请重新登录', |
|
@@ -79,6 +79,7 @@ if(responseInterceptor === undefined){ |
|
|
}) |
|
|
}) |
|
|
.then(() => { |
|
|
.then(() => { |
|
|
store.dispatch('LogOut').then(() => { |
|
|
store.dispatch('LogOut').then(() => { |
|
|
|
|
|
console.log('退出') |
|
|
try { |
|
|
try { |
|
|
let loginUrl = Cookies.get("_Login_url"); |
|
|
let loginUrl = Cookies.get("_Login_url"); |
|
|
if(loginUrl && loginUrl.indexOf("onlineHomeLogin") !== -1) { |
|
|
if(loginUrl && loginUrl.indexOf("onlineHomeLogin") !== -1) { |
|
@@ -120,11 +121,13 @@ if(responseInterceptor === undefined){ |
|
|
window.location.href = '/contracted/login'; |
|
|
window.location.href = '/contracted/login'; |
|
|
return; |
|
|
return; |
|
|
}else{ |
|
|
}else{ |
|
|
if(!window.location.href.indexOf('/Login') && !window.location.href.indexOf('/login')){ |
|
|
|
|
|
|
|
|
console.log('退出login') |
|
|
|
|
|
console.log(window.location.href.indexOf('/Login') < 0) |
|
|
|
|
|
console.log(window.location.href.indexOf('/login') < 0) |
|
|
|
|
|
if(window.location.href.indexOf('/Login') < 0 && window.location.href.indexOf('/login') < 0){ |
|
|
// 产权交易 |
|
|
// 产权交易 |
|
|
window.location.href = '/login'; |
|
|
window.location.href = '/login'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|