Browse Source

401 不需要提示请求错误。

pull/3858/head
jiang 7 years ago
committed by GitHub
parent
commit
74c4037999
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/utils/request.js

9
src/utils/request.js

@ -32,11 +32,6 @@ const errorHandler = error => {
const errortext = codeMessage[response.status] || response.statusText; const errortext = codeMessage[response.status] || response.statusText;
const { status, url } = response; const { status, url } = response;
notification.error({
message: `请求错误 ${status}: ${url}`,
description: errortext,
});
if (status === 401) { if (status === 401) {
notification.error({ notification.error({
message: '未登录或登录已过期,请重新登录。', message: '未登录或登录已过期,请重新登录。',
@ -48,6 +43,10 @@ const errorHandler = error => {
}); });
return; return;
} }
notification.error({
message: `请求错误 ${status}: ${url}`,
description: errortext,
});
// environment should not be used // environment should not be used
if (status === 403) { if (status === 403) {
router.push('/exception/403'); router.push('/exception/403');

Loading…
Cancel
Save