Commit 6470e034 authored by nikogu's avatar nikogu
parent 558da10f
@import "~antd/lib/style/themes/default.less"; @import "~antd/lib/style/themes/default.less";
.globalFooter { .globalFooter {
margin: 32px 28px 16px; padding: 16px;
margin: 32px 0 16px 0;
text-align: center; text-align: center;
.links { .links {
......
import fetch from 'dva/fetch'; import fetch from 'dva/fetch';
import { notification } from 'antd';
function checkStatus(response) { function checkStatus(response) {
if (response.status >= 200 && response.status < 300) { if (response.status >= 200 && response.status < 300) {
return response; return response;
} }
const error = new Error(response.statusText); return response.json().then((result) => {
error.response = response; if (result.code) {
throw error; notification.error({
message: result.name,
description: result.message,
});
}
if (result.stack) {
notification.error({
message: '请求错误',
description: result.message,
});
}
const error = new Error(result.message);
error.response = response;
throw error;
});
} }
/** /**
......
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