Skip to content

Commit

Permalink
401 不需要提示请求错误。
Browse files Browse the repository at this point in the history
  • Loading branch information
jljsj33 authored Apr 1, 2019
1 parent 569f1cd commit 74c4037
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/utils/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ const errorHandler = error => {
const errortext = codeMessage[response.status] || response.statusText;
const { status, url } = response;

notification.error({
message: `请求错误 ${status}: ${url}`,
description: errortext,
});

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

0 comments on commit 74c4037

Please sign in to comment.