Commit 7da03725 by 姜雷

修改报修接口报错提示方式

parent 88df2d71
...@@ -201,18 +201,22 @@ class ReprtRepair extends Component { ...@@ -201,18 +201,22 @@ class ReprtRepair extends Component {
.then(res => { .then(res => {
console.log(res); console.log(res);
const { data } = res; const { data } = res;
const { history } = this.props; if (data.code && data.code === 1000) {
console.log('resetForm'); const { data } = res;
this.resetApplyForm(); const { history } = this.props;
// Toast.hide(); console.log('resetForm');
Toast.success(data.msg); this.resetApplyForm();
history.replace('/repair/RepairList'); // Toast.hide();
Toast.success(data.msg);
history.replace('/repair/RepairList');
} else {
throw { msg: data.msg };
}
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
const { data } = err;
// Toast.hide(); // Toast.hide();
Toast.fail(data.msg || '提交失败!'); Toast.fail(err.msg || '提交失败!');
}); });
}; };
resetDialog = () => { resetDialog = () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment