张泽亮 vor 1 Jahr
Ursprung
Commit
80c2ca64af
2 geänderte Dateien mit 14 neuen und 8 gelöschten Zeilen
  1. +9
    -6
      src/utils/request.js
  2. +5
    -2
      src/views/user/index.vue

+ 9
- 6
src/utils/request.js Datei anzeigen

@@ -60,7 +60,7 @@ if(requestInterceptor === undefined){

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

}

})


+ 5
- 2
src/views/user/index.vue Datei anzeigen

@@ -106,7 +106,7 @@ export default {
for(var i = keys.length; i--;)
document.cookie = keys[i] + '=0;expires=' + new Date(0).toUTCString()
}
this.$router.push({name:'index'})
this.$router.push({name:'indexCJ'})
});
},
getInfo(){
@@ -120,7 +120,10 @@ export default {
this.activitiStatus = response.data.activitiStatus;
this.instanceId = response.data.instanceId;
this.memberType = response.data.memberType;
this.getHistoryList()
if(this.instanceId !== "" && this.instanceId != null){
this.getHistoryList()
}

});
});
},


Laden…
Abbrechen
Speichern