| 35 | */ |
| 36 | |
| 37 | const 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 | }; |
| 54 | export 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 |
nothing calls this directly
no outgoing calls
no test coverage detected