|
|
|
@ -67,13 +67,15 @@ class Request { |
|
|
|
|
if (_this.resInterceptors && typeof _this.resInterceptors === 'function') { |
|
|
|
|
let resInterceptors = _this.resInterceptors(res); |
|
|
|
|
// console.log('resInterceptors-----------------',resInterceptors)
|
|
|
|
|
if(resInterceptors.statusCode == 400 || resInterceptors.data.code == 403){ |
|
|
|
|
if(resInterceptors.statusCode == 401 || resInterceptors.data.code == 403){ |
|
|
|
|
$.toast('登录信息已过期,请重新登录') |
|
|
|
|
$.removeData('token') |
|
|
|
|
setTimeout(() => { |
|
|
|
|
$.openNew('/pages/logIn/logIn') |
|
|
|
|
},1500) |
|
|
|
|
return |
|
|
|
|
}else if(resInterceptors.statusCode != 200){ |
|
|
|
|
$.toast(resInterceptors.data.message) |
|
|
|
|
} |
|
|
|
|
if (!resInterceptors && resInterceptors != '') { |
|
|
|
|
reject('返回值已被您拦截!'); |
|
|
|
|