|
@@ -224,7 +224,20 @@ export const createAxiosByinterceptors = (config) => {
|
|
|
return response.data;
|
|
|
},
|
|
|
function (error) {
|
|
|
+ console.error('error.config.url', error.config.url)
|
|
|
console.log('error', error);
|
|
|
+ // 请求超时
|
|
|
+ if (error.code === 'ECONNABORTED') {
|
|
|
+ let msg = '请求超时,请稍后重试'
|
|
|
+ if(error.config.url.indexOf('parking-lots/lbs') > -1) {
|
|
|
+ msg = '车场连接有问题,请联系服务台!'
|
|
|
+ }
|
|
|
+ const toast = Toast(msg)
|
|
|
+ setTimeout(() => {
|
|
|
+ toast.clear()
|
|
|
+ }, 3000)
|
|
|
+ return Promise.reject(error.code);
|
|
|
+ }
|
|
|
// 断网
|
|
|
if (error.code === 'ERR_NETWORK') {
|
|
|
uni.showToast({ title: '网络连接失败,请重试', duration: 3000, icon: 'fail' });
|