From 8c0fd05b75935f892232b60193f4e143be88395c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 19 Jul 2019 23:27:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/FindPasswordComponent.js | 26 +++++--- .../modules/user/LoginRegisterComponent.js | 59 ++++++++++++++++--- 2 files changed, 68 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/user/FindPasswordComponent.js b/public/react/src/modules/user/FindPasswordComponent.js index f7d16bf50..7542bc4ee 100644 --- a/public/react/src/modules/user/FindPasswordComponent.js +++ b/public/react/src/modules/user/FindPasswordComponent.js @@ -193,23 +193,23 @@ class LoginRegisterComponent extends Component { this.openNotification(`两次输入的密码不一致`); return } - else if (this.state.password !==undefined ||this.state.password.length>0&&this.state.password.length<8){ + else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length<8){ this.setState({ Phonenumberisnotcosmmm:"密码不能少于8位", }) return - } else if (this.state.password !==undefined ||this.state.password.length>0&&this.state.password.length>16){ + } else if (this.state.password !==undefined&&this.state.password.length>0&&this.state.password.length>16){ this.setState({ Phonenumberisnotcosmmm:"密码不能超过16位", }) return } - else if (this.state.passwords !==undefined ||this.state.passwords.length>0&&this.state.passwords.length<8){ + else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length<8){ this.setState({ Phonenumberisnotcosymmmm:"二次密码不能少于8位", }) return - } else if (this.state.passwords !==undefined ||this.state.passwords.length>0&&this.state.passwords.length>16){ + } else if (this.state.passwords !==undefined&&this.state.passwords.length>0&&this.state.passwords.length>16){ this.setState({ Phonenumberisnotcosymmmm:"二次密码不能超过16位", }) @@ -297,6 +297,7 @@ class LoginRegisterComponent extends Component { } this.setState({ password: stirngt, + Phonenumberisnotcosmmm:undefined, }) } @@ -311,13 +312,15 @@ class LoginRegisterComponent extends Component { } this.setState({ passwords: stirngt, + Phonenumberisnotcosymmmm:undefined, }) } //获取code codesonChange = (e) => { this.setState({ - codes: e.target.value + codes: e.target.value, + Phonenumberisnotcosyzm:undefined, }) } inputOnBlur = (e) => { @@ -388,6 +391,9 @@ class LoginRegisterComponent extends Component { }) return } + this.setState({ + Phonenumberisnotcosytdhk:undefined, + }) this.Emailphonenumberverification(this.state.login) } @@ -520,7 +526,7 @@ class LoginRegisterComponent extends Component { {/*onBlur={(e) => this.inputOnBlur(e)}*/} { @@ -560,7 +566,7 @@ class LoginRegisterComponent extends Component { :
} @@ -573,7 +579,7 @@ class LoginRegisterComponent extends Component { } }
- { if (this.state.login === undefined || this.state.login == "") { - this.openNotification(`请输入登录手机号码或邮箱`,2); + this.setState({ + Phonenumberisnotco:"账号不能为空", + }) return } else if (this.state.password === undefined || this.state.password == "") { - this.openNotification(`请输入密码`,2); + this.setState({ + Phonenumberisnotcodmm:"密码不能为空", + }) return } var url = "/accounts/login.json"; @@ -208,6 +214,34 @@ class LoginRegisterComponent extends Component { if (response === undefined) { return } + if(response.status === -2){ + if("该手机号尚未注册" || "该邮箱尚未注册"){ + this.setState({ + Phonenumberisnotco:result.data.message, + }) + return; + } + else if("错误的账号或密码"){ + this.setState({ + Phonenumberisnotco:result.data.message, + }) + return; + } + else if("违反平台使用规范,账号已被锁定"){ + this.setState({ + Phonenumberisnotco:result.data.message, + }) + + return; + } + else { + this.openNotification(result.data.message); + return; + } + + + } + if (response.status === 200) { if (response.data.status === 402) { window.location.href = response.data.url; @@ -268,12 +302,12 @@ class LoginRegisterComponent extends Component { Phonenumberisnotcosymmm:"密码不能为空", }) return - } else if (this.state.passwords !==undefined ||this.state.passwords.length>0&&this.state.passwords.length<8){ + } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length<8){ this.setState({ Phonenumberisnotcosymmm:"密码不能少于8位", }) return - } else if (this.state.passwords !==undefined ||this.state.passwords.length>0&&this.state.passwords.length>16){ + } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length>16){ this.setState({ Phonenumberisnotcosymmm:"密码不能超过16位", }) @@ -507,6 +541,7 @@ class LoginRegisterComponent extends Component { }else{ this.setState({ login: stirngt, + Phonenumberisnotco:undefined, }) } @@ -528,6 +563,7 @@ class LoginRegisterComponent extends Component { } this.setState({ password: stirngt, + Phonenumberisnotcodmm:undefined, }) // this.setState({ // password: e.target.value @@ -628,6 +664,7 @@ class LoginRegisterComponent extends Component { Phonenumberisnotcosytdhk, Phonenumberisnotcosyzm, Phonenumberisnotcosymmm, + Phonenumberisnotcodmm, // 注册 readAgreement, } = this.state @@ -692,7 +729,7 @@ class LoginRegisterComponent extends Component { this.inputOnBlur(e, 1)} style={{marginTop: '30px', height: '38px'}}> @@ -706,11 +743,17 @@ class LoginRegisterComponent extends Component { + { + Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ? +

+ {Phonenumberisnotcodmm} +

+ :
+ } -
+
下次自动登录 this.StudyMakeMoney()}