From b069aa6b30a0651e820534b76bc96b9ad06f987f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=84=9A=E9=81=93?= Date: Fri, 21 Dec 2018 18:43:51 +0800 Subject: [PATCH] remove redirect when api error --- src/utils/request.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index 150c8608..ea9fed24 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -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'); - } }; /** -- GitLab