|
@@ -65,9 +65,6 @@ function interceptors(){
|
|
|
}, function (error) {
|
|
|
return Promise.reject(error);
|
|
|
});
|
|
|
- function toLogin(){
|
|
|
- window.location = '/';
|
|
|
- }
|
|
|
//拦截响应
|
|
|
axios.interceptors.response.use(function (res) {
|
|
|
const code = (res.data||{}).code;
|
|
@@ -79,25 +76,25 @@ function interceptors(){
|
|
|
setCookie();
|
|
|
const isOverTime = localStorage.getItem("overTime");
|
|
|
if(!isOverTime){
|
|
|
- console.log(444,res)
|
|
|
- const msg = res.data.message;
|
|
|
- Modal.confirm({
|
|
|
- title:'提示',
|
|
|
- content:msg||`登录信息失效,请重新登录`,
|
|
|
- footer:`<Button key="submit" type="primary" onClick={()=>{ window.location = '/';}}>知道了</Button>`,
|
|
|
- /*onOk:function(){
|
|
|
- window.location = '/';
|
|
|
- }*/
|
|
|
- })
|
|
|
+ /* console.log(444,res)
|
|
|
+ const msg = res.data.message;
|
|
|
+ /*Modalonfirm({
|
|
|
+ title:'提示',
|
|
|
+ content:msg||`登录信息失效,请重新登录`,
|
|
|
+ footer:`<Button key="submit" type="primary" onClick={()=>{ window.location = '/';}}>知道了</Button>`,
|
|
|
+ /!*onOk:function(){
|
|
|
+ window.location = '/';
|
|
|
+ }*!/
|
|
|
+ })*/
|
|
|
//message.error("登录信息失效,请重新登录");
|
|
|
}
|
|
|
//标记登录失效被退出,后面的请求不发送/不显示相应消息
|
|
|
localStorage.setItem("overTime",1);
|
|
|
//localStorage.removeItem("hospitalId");
|
|
|
- //window.location = '/';
|
|
|
+ window.location = '/';
|
|
|
}else{
|
|
|
localStorage.removeItem("overTime");
|
|
|
- return res;
|
|
|
+ return res;
|
|
|
}
|
|
|
}, function (error) {
|
|
|
return Promise.reject(error);
|