Pārlūkot izejas kodu

小青蛙新增:过滤以430300开头的正则

zh 7 mēneši atpakaļ
vecāks
revīzija
d9315a536c
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      src/views/piece/dashboard/index.vue

+ 3 - 1
src/views/piece/dashboard/index.vue

@@ -316,8 +316,10 @@ const _handlerScan = (code) => {
     }
     // 数字0-9,大写字母A-Z,部分特殊字符(空格、! " % & ' ( ) * + , - . / : ; < = > ? _)
     const code128BPattern = /^[\x20-\x7F]+$/;
+    // 新增:过滤以430300开头的正则
+    const startsWithPattern = /^430300.*/;
     // 检查是否只包含有效字符
-    if (!code128BPattern.test(code)) {
+    if (!code128BPattern.test(code) || startsWithPattern.test(code)) {
       console.log(code)
       scanErr()
       showNotify({ type: 'danger', style: 'font-size: 30px !important;height:50px', message: '请扫描正确的快递单号!' });