From 66e4a5522b36fe33f428c7c613e2346ce3e3ba17 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 19:37:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/LoginRegisterComponent.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index addd0e81b..030103ea2 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -212,8 +212,8 @@ class LoginRegisterComponent extends Component { Phonenumberisnotcos: undefined, Phonenumberisnotcobool: true, }) + this.Emailphonenumberverification(value, id) } - this.Emailphonenumberverification(value, id) return } @@ -222,8 +222,11 @@ class LoginRegisterComponent extends Component { stringdata = "邮箱格式不正确"; } else { stringdata = "手机号格式不正确"; - - } + if (!regph.test(value)) { + // 这里先判断是不是手机号然后在判断是不是邮箱然后又判断是不是手机号,如果不是手机号就是账号 + stringdata=undefined; + } + } if (id === 1) { this.setState({ Phonenumberisnotco: stringdata, @@ -234,8 +237,8 @@ class LoginRegisterComponent extends Component { Phonenumberisnotcos: stringdata, Phonenumberisnotcobool: false, }) + this.Emailphonenumberverification(value, id) } - this.Emailphonenumberverification(value, id) return } else { if (id === 1) { @@ -248,8 +251,8 @@ class LoginRegisterComponent extends Component { Phonenumberisnotcos: undefined, Phonenumberisnotcobool: true, }) + this.Emailphonenumberverification(value, id) } - this.Emailphonenumberverification(value, id) return } }