MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / errorHandler

Function errorHandler

src/utils/request.js:37–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35 */
36
37const errorHandler = error => {
38 const { response } = error;
39 if (response && response.status) {
40 const errorText = codeMessage[response.status] || response.statusText;
41 const { status, url } = response;
42 notification.error({
43 message: `请求错误 ${status}: ${url}`,
44 description: errorText,
45 });
46 } else if (!response) {
47 notification.error({
48 description: '您的网络发生异常,无法连接服务器',
49 message: '网络异常',
50 });
51 }
52 return response;
53};
54export const baseUrl = process.env.NODE_ENV === 'development' ? 'https://moctest.sobeylingyun.com' : window.location.origin // 线上
55 // https://moctest.sobeylingyun.com // http://172.16.164.7:8090
56

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected