提交 b069aa6b 编写于 作者: 愚道 提交者: Yu

remove redirect when api error

上级 b42ef12b
......@@ -4,7 +4,6 @@
*/
import { extend } from 'umi-request';
import { notification } from 'antd';
import router from 'umi/router';
const codeMessage = {
200: '服务器成功返回请求的数据。',
......@@ -36,24 +35,6 @@ const errorHandler = error => {
message: `请求错误 ${status}: ${url}`,
description: errortext,
});
if (status === 401) {
notification.error({
message: '未登录或登录已过期,请重新登录。',
});
}
// environment should not be used
if (status === 403) {
router.push('/exception/403');
return;
}
if (status <= 504 && status >= 500) {
router.push('/exception/500');
return;
}
if (status >= 404 && status < 422) {
router.push('/exception/404');
}
};
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册