解决全局异常报错

This commit is contained in:
red-deng-deng 2021-11-30 01:51:16 +08:00
parent a95504160b
commit 1f17bc6efa
2 changed files with 5 additions and 8 deletions

View File

@ -163,8 +163,8 @@ export const handelResponse = (res, cb, errCb) => {
cb(res.data, res.message) cb(res.data, res.message)
} else { } else {
if (res&&typeof errCb == 'function') { if (res&&typeof errCb == 'function') {
Notify.clear(); Notify.clear();
Notify.error(res.message); Notify.error(res.message);
errCb(res.message) errCb(res.message)
} }
} }

View File

@ -201,9 +201,7 @@ export default class adduserinfo extends React.Component{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
},err=>{ },err=>{
Notify.clear();
Notify.error(res.data.message);
return false;
}); });
}).catch(err=>{ }).catch(err=>{
@ -215,9 +213,8 @@ export default class adduserinfo extends React.Component{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
},err=>{ },err=>{
Notify.clear();
Notify.error(res.data.message);
return false;
}); });
}).catch(err=>{ }).catch(err=>{