Commit e7bc8e1f by zhaochengxiang

post问题

parent 8bc1248c
......@@ -24,8 +24,20 @@ function* request(args) {
yield call(callback, rs)
} catch (ex) {
if (ex) {
ex.ApiError && ex.ApiError.cnMessage && showErrorNotifaction('系统异常', ex.ApiError.cnMessage, 5);
if (ex?.ApiError?.cnMessage) {
showErrorNotifaction('系统异常', ex.ApiError.cnMessage, 5);
error && error(ex);
} else if (ex?.response?.data) {
let newData = {};
try {
newData = JSON.parse(ex?.response?.data);
showErrorNotifaction('系统异常', newData.ApiError?.cnMessage, 5);
error && error(ex);
} catch(error) {
showErrorNotifaction('系统异常', ex?.response?.data, 5);
error && error(ex);
}
}
}
}
}
......
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