Browse Source

More notification when api failed

pull/106/head
afc163 9 years ago
parent
commit
66d5996983
  1. 4
      src/utils/request.js

4
src/utils/request.js

@ -5,6 +5,10 @@ function checkStatus(response) {
if (response.status >= 200 && response.status < 300) {
return response;
}
notification.error({
message: `请求错误 ${response.status}: ${response.url}`,
description: response.statusText,
});
const error = new Error(response.statusText);
error.response = response;
throw error;

Loading…
Cancel
Save