订单更为成功

This commit is contained in:
red-deng-deng 2021-11-28 16:12:41 +08:00
parent 3e7676879b
commit d4e717201b
2 changed files with 33 additions and 3 deletions

View File

@ -87,9 +87,39 @@ const req = (method, url, params, responseType) => {
let http = fetch(url, obj).then(res =>{
window.timeshow=res.headers.get('Date-Time');
return res.json()
console.log(res);
if(res.status==200){
return res.json()
}else{
switch (res.status) {
// 401: 未登录
case 401:
Notify.clear();
Notify.error( "当前信息过期请重新登录");
setTimeout(() => {
window.location.href='./login';
}, 3000)
break;
case 417:
Notify.clear();
Notify.error( res.statusText);
break;
case 500:
Notify.clear();
Notify.error( res.statusText);
break;
default:
Notify.clear();
Notify.error( res.statusText);
break;
}
}
console.log(res);
} );
return http.then(response => response).catch(error => console.error('Error:', error));
return http.then(response =>response).catch(error => console.error('Error:', error));
}
export const handelResponse = (res, cb, errCb) => {

View File

@ -562,7 +562,7 @@ componentDidUpdate(prevProps,prevState){
// rowData.status==3? <span className="grid-link" onClick={(e)=>this.againinvestFn(e,rowData)}>再次充值</span>:null
}
{
rowData.status==1? <span className="grid-link" onClick={(e)=>this.deleteFn(e,rowData)} >改为成功</span>:null
rowData.status==1? <span className="grid-link" onClick={(e)=>this.changeSuccessFn(e,rowData)} >改为成功</span>:null
}
</div>