diff --git a/src/utils/request.js b/src/utils/request.js index def290be8eef27168b5619ae3d1d5b82103ef015..0801b1d4b1cb0dc8c1bc86ce7f70e9a3457b364e 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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: '未登录或登录已过期,请重新登录。', @@ -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');