|
@@ -176,11 +176,14 @@ export const createAxiosByinterceptors = (config) => {
|
|
|
}
|
|
|
}
|
|
|
// 错误信息提示
|
|
|
- const { code, langMessage, message } = error.response.data;
|
|
|
+ const { code, langMessage, message,status } = error.response.data;
|
|
|
const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_NOT_FOUND', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCAL_PARK_ERROR", "LOCK_OCCUPIED", "REMOTE_CALL_FAIL", 'PLEASE_SCAN_QRCODE']; // 默认处理的错误code
|
|
|
if (codeList.indexOf(code) > -1) {
|
|
|
uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
|
|
|
}
|
|
|
+ if ( status === 500 ) {
|
|
|
+ uni.showToast({ title: error.response.data.error, duration: 3000, icon: 'fail' });
|
|
|
+ }
|
|
|
// Message.error(error?.response?.data?.message || '服务端异常');
|
|
|
return Promise.reject(error.response.data);
|
|
|
}
|