Browse Source

修改身份证号校验规则

lex-xin 4 years ago
parent
commit
488d3dcca9

File diff suppressed because it is too large
+ 0 - 0
dist/app.48a6986b946a016d46b4.js


BIN
dist/app.48a6986b946a016d46b4.js.gz


BIN
dist/app.4d979555cf7a7963d1ce.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/css/SignUpBaseInfo.344cb86f.css


BIN
dist/css/SignUpBaseInfo.33618853.css.gz → dist/css/SignUpBaseInfo.344cb86f.css.gz


File diff suppressed because it is too large
+ 0 - 0
dist/index.html


File diff suppressed because it is too large
+ 0 - 0
dist/js/SignUpBaseInfo.59bc3f08.js


BIN
dist/js/SignUpBaseInfo.59bc3f08.js.gz


File diff suppressed because it is too large
+ 0 - 0
dist/js/SignUpBaseInfo.ff148601.js


BIN
dist/js/SignUpBaseInfo.ff148601.js.gz


+ 14 - 9
src/views/signup/SignUpBaseInfo.vue

@@ -165,15 +165,17 @@ export default {
         },
         onCardNo() {
             let form = this.form
-            // 身份证号检验
-            if(!validateCardNo(form.idCardNo)) {
-                this.$toast('输入身份证号有误')
-                return
+            if(form.idCardNo.length >= 15) { // 大于15位说明是大陆身份证
+                // 身份证号检验
+                if(!validateCardNo(form.idCardNo)) {
+                    this.$toast('输入身份证号有误')
+                    return
+                }
+                let birthday = this.getBirth(form.idCardNo)
+                let sex = this.getSex(form.idCardNo)
+                form.gender = sex
+                form.birthdate = birthday
             }
-            let birthday = this.getBirth(form.idCardNo)
-            let sex = this.getSex(form.idCardNo)
-            form.gender = sex
-            form.birthdate = birthday
         },
         getBirth(idCard) {
             let birthday = "";
@@ -325,7 +327,10 @@ export default {
         },
         onCheckFields() { // 校验字段
             let form = this.form
-            if(!validateCardNo(form.idCardNo)) {
+            if(!form.idCardNo) {
+                this.$toast("请输入身份证号")
+                return false
+            } else if(form.idCardNo.length > 15 && !validateCardNo(form.idCardNo)) {
                 this.$toast("输入身份证号有误")
                 return false
             } else if(!form.realName) {

Some files were not shown because too many files changed in this diff