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;
if (data.code && data.code === 1000) {
const { data } = res;
const { history } = this.props; const { history } = this.props;
console.log('resetForm'); console.log('resetForm');
this.resetApplyForm(); this.resetApplyForm();
// Toast.hide(); // Toast.hide();
Toast.success(data.msg); Toast.success(data.msg);
history.replace('/repair/RepairList'); 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