From a8e2c9ef3bac685043154ab4858cc6ebe2618bd5 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 8 Jun 2023 10:59:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=89=BE=E5=9B=9E=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=A0=A1=E9=AA=8C=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/forgetPassword.vue | 4 ++-- src/views/login/registerUser.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/login/forgetPassword.vue b/src/views/login/forgetPassword.vue index 7a351683b..2f1de50a4 100644 --- a/src/views/login/forgetPassword.vue +++ b/src/views/login/forgetPassword.vue @@ -84,7 +84,7 @@ export default { } }; var validatePhone = (rule, value, callback) => { - const regu = /^1(3[0-9]|4[5,7]|5[0,1,2,3,5,6,7,8,9]|6[2,5,6,7]|7[0,1,7,8]|8[0-9]|9[1,8,9])\d{8}$/; + const regu = /^1\d{10}$/; const re = new RegExp(regu); if (!re.test(value)) { callback(new Error('手机号格式不正确')); @@ -184,7 +184,7 @@ export default { }, async sendVfcode() { const reguEmail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/; - const reguPhone = /^1(3[0-9]|4[5,7]|5[0,1,2,3,5,6,7,8,9]|6[2,5,6,7]|7[0,1,7,8]|8[0-9]|9[1,8,9])\d{8}$/; + const reguPhone = /^1\d{10}$/; const rePhone = new RegExp(reguPhone); const reEmail = new RegExp(reguEmail); if (this.form.type === 'phone' && this.form.phone && rePhone.test(this.form.phone)) { diff --git a/src/views/login/registerUser.vue b/src/views/login/registerUser.vue index 85ff111e0..1e234a5fc 100644 --- a/src/views/login/registerUser.vue +++ b/src/views/login/registerUser.vue @@ -98,7 +98,7 @@ export default { } }; var validateMobile = (rule, value, callback) => { - const regu = /^1(3[0-9]|4[5,7]|5[0,1,2,3,5,6,7,8,9]|6[2,5,6,7]|7[0,1,7,8]|8[0-9]|9[1,8,9])\d{8}$/; + const regu = /^1\d{10}$/; const re = new RegExp(regu); if (!re.test(value)) { callback(new Error('手机号格式不正确')); @@ -213,7 +213,7 @@ export default { }, sendVfcodeFunc() { const reguEmail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/; - const reguMobile = /^1(3[0-9]|4[5,7]|5[0,1,2,3,5,6,7,8,9]|6[2,5,6,7]|7[0,1,7,8]|8[0-9]|9[1,8,9])\d{8}$/; + const reguMobile = /^1\d{10}$/; const reMobile = new RegExp(reguMobile); const reEmail = new RegExp(reguEmail); if (this.form.type === 'mobile' && this.form.mobile && reMobile.test(this.form.mobile)) {