From 7cf13ed4dff8c599c0675463e92c88f54f52697a Mon Sep 17 00:00:00 2001 From: liuye Date: Fri, 25 Nov 2022 16:12:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BA=AB=E4=BB=BD=E8=AF=81=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/project/pingchang/AppCommunityManagement/Edit.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/project/pingchang/AppCommunityManagement/Edit.vue b/src/project/pingchang/AppCommunityManagement/Edit.vue index 17bdfe9e..9fc6e8dd 100644 --- a/src/project/pingchang/AppCommunityManagement/Edit.vue +++ b/src/project/pingchang/AppCommunityManagement/Edit.vue @@ -202,7 +202,9 @@ export default { if (!this.form.idNumber && this.fromType != 1) { return this.$u.toast('请输入身份证号') } - if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber) && this.fromType != 1) { + let reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; + + if (this.form.idNumber.length == 18 && !reg.test(this.form.idNumber) && this.fromType != 1) { return this.$u.toast('请输入正确的身份证账号') } if (!this.form.phone && this.fromType != 1) {