注册找回账号手机号校验格式调整

This commit is contained in:
fan 2023-06-08 10:59:50 +08:00
parent d232546e8c
commit a8e2c9ef3b
2 changed files with 4 additions and 4 deletions

View File

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

View File

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