身份证号码校验替换

This commit is contained in:
liuye
2023-04-25 14:06:40 +08:00
parent 235553d1c2
commit 00e059e536
7 changed files with 7 additions and 7 deletions

View File

@@ -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) => {

View File

@@ -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) => {