From 66d599698338caa39a6540b73906bd7cd8ce1f4d Mon Sep 17 00:00:00 2001 From: afc163 Date: Fri, 3 Nov 2017 14:27:54 +0800 Subject: [PATCH] More notification when api failed --- src/utils/request.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/request.js b/src/utils/request.js index 6ffa7beb..094f7fc9 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -5,6 +5,10 @@ function checkStatus(response) { if (response.status >= 200 && response.status < 300) { return response; } + notification.error({ + message: `请求错误 ${response.status}: ${response.url}`, + description: response.statusText, + }); const error = new Error(response.statusText); error.response = response; throw error; -- GitLab