Browse Source

feat: The network terminal also triggers an error message. #5096 (#5112)

* 解决客户端网络异常(如wifi断线)时,网络请求后无法触发notification.error的问题 #5096

* 解决客户端网络异常(如wifi断线)时,网络请求后无法触发notification.error的问题 #5096
pull/5124/head
毛松 7 years ago
committed by 陈帅
parent
commit
b11aa409e7
  1. 5
      src/utils/request.ts

5
src/utils/request.ts

@ -36,6 +36,11 @@ const errorHandler = (error: { response: Response }): Response => {
message: `请求错误 ${status}: ${url}`,
description: errorText,
});
} else if (!response) {
notification.error({
description: '您的网络发生异常,无法连接服务器',
message: '网络异常',
});
}
return response;
};

Loading…
Cancel
Save