* 解决客户端网络异常(如wifi断线)时,网络请求后无法触发notification.error的问题 #5096 * 解决客户端网络异常(如wifi断线)时,网络请求后无法触发notification.error的问题 #5096
@@ -36,6 +36,11 @@ const errorHandler = (error: { response: Response }): Response => {
message: `请求错误 ${status}: ${url}`,
description: errorText,
});
+ } else if (!response) {
+ notification.error({
+ description: '您的网络发生异常,无法连接服务器',
+ message: '网络异常',
+ });
}
return response;
};