身份证号码校验替换
This commit is contained in:
@@ -150,7 +150,7 @@ export default {
|
||||
}
|
||||
|
||||
if (
|
||||
!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)
|
||||
!/^[1-9]\d{5}(19\d{2}|20[0-2]\d)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9xX])$/.test(this.form.idNumber)
|
||||
) {
|
||||
return this.$u.toast("请输入正确的身份证账号");
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ export default {
|
||||
return this.$u.toast('请输入身份证号')
|
||||
}
|
||||
if(this.form.idNumber) {
|
||||
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)) {
|
||||
if (!/^[1-9]\d{5}(19\d{2}|20[0-2]\d)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9xX])$/.test(this.form.idNumber)) {
|
||||
return this.$u.toast('请输入正确的身份证号')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ export default {
|
||||
if (!this.info.idNumber) {
|
||||
return this.$u.toast('请输入身份证号')
|
||||
}
|
||||
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.info.idNumber)) {
|
||||
if (!/^[1-9]\d{5}(19\d{2}|20[0-2]\d)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9xX])$/.test(this.info.idNumber)) {
|
||||
return this.$u.toast('请输入正确的身份证账号')
|
||||
}
|
||||
this.$http.post(`/app/appepidemicpreventionregisterinfo/updateForAdmin`, this.info).then((res) => {
|
||||
|
||||
@@ -322,7 +322,7 @@ export default {
|
||||
if (!this.info.idNumber) {
|
||||
return this.$u.toast('请输入身份证号')
|
||||
}
|
||||
if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.info.idNumber)) {
|
||||
if (!/^[1-9]\d{5}(19\d{2}|20[0-2]\d)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9xX])$/.test(this.info.idNumber)) {
|
||||
return this.$u.toast('请输入正确的身份证账号')
|
||||
}
|
||||
this.$http.post(`/app/appepidemicpreventionregisterinfo/updateForAdmin`, this.info).then((res) => {
|
||||
|
||||
@@ -434,7 +434,7 @@ export default {
|
||||
}
|
||||
|
||||
if (
|
||||
!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)
|
||||
!/^[1-9]\d{5}(19\d{2}|20[0-2]\d)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9xX])$/.test(this.form.idNumber)
|
||||
) {
|
||||
return this.$u.toast("请输入正确的身份证账号");
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ export default {
|
||||
return this.$u.toast('请输入身份证号')
|
||||
}
|
||||
if (
|
||||
!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)
|
||||
!/^[1-9]\d{5}(19\d{2}|20[0-2]\d)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9xX])$/.test(this.form.idNumber)
|
||||
) {
|
||||
return this.$u.toast("请输入正确的身份证账号");
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ export default {
|
||||
return this.$u.toast('请输入身份证号')
|
||||
}
|
||||
if (
|
||||
!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.form.idNumber)
|
||||
!/^[1-9]\d{5}(19\d{2}|20[0-2]\d)(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])\d{3}([0-9xX])$/.test(this.form.idNumber)
|
||||
) {
|
||||
return this.$u.toast("请输入正确的身份证账号");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user