Parcourir la source

feat(scrm-3300):解决当前报错错误码的message

lock.qiu@kerryprops.com il y a 2 ans
Parent
commit
9ae9e3efc3

+ 1 - 1
src/api/request.js

@@ -175,7 +175,7 @@ export const createAxiosByinterceptors = (config) => {
       }
       }
       // 错误信息提示
       // 错误信息提示
       const { code, langMessage, message } = error.response.data;
       const { code, langMessage, message } = error.response.data;
-      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_NOT_FOUND', 'CAR_HAS_PLATE', "NOT_FOUND"]; // 默认处理的错误code
+      const codeList = ['INTERNAL_SERVER_ERROR', 'VALIDATION_FAILED', 'CAR_NOT_FOUND', 'CAR_HAS_PLATE', "NOT_FOUND", "LOCK_OCCUPIED"]; // 默认处理的错误code
       if (codeList.indexOf(code) > -1) {
       if (codeList.indexOf(code) > -1) {
         uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
         uni.showToast({ title: langMessage || message, duration: 3000, icon: 'fail' });
       }
       }

+ 5 - 15
src/pages/parkingFee/mixins/parkingReceipt/parkingApplication.js

@@ -216,14 +216,11 @@ export default {
           });
           });
           const headerInfo = list[currentIndex] || {};
           const headerInfo = list[currentIndex] || {};
           self.headerInfo = headerInfo;
           self.headerInfo = headerInfo;
-        } else {
-          Toast({
-            message: '服务器开小差了呢,请您稍后再试',
-          });
         }
         }
-      } catch {
+      } catch(err) {
+        console.log(111, err)
         uni.showToast({
         uni.showToast({
-          title: '服务器开小差了呢,请您稍后再试',
+          title: err.langMessage,
           icon: 'none',
           icon: 'none',
         });
         });
       }
       }
@@ -427,16 +424,9 @@ export default {
       this.$router.replace({
       this.$router.replace({
         path: 'parkingReceipt',
         path: 'parkingReceipt',
       });
       });
-    } else {
-      Toast({
-        message: '服务器开小差了呢,请您稍后再试',
-      });
     }
     }
-  } catch {
-    uni.showToast({
-      title: '服务器开小差了呢,请您稍后再试',
-      icon: 'none',
-    });
+  } catch (err) {
+    console.log(111, err);
   }
   }
 //   uni.request({
 //   uni.request({
 //   // url: self.$baseURL + 'api/1.0/invoice/addMyInvoiceInfo',
 //   // url: self.$baseURL + 'api/1.0/invoice/addMyInvoiceInfo',