dev_forum
杨树林 6 years ago
parent 5446311e12
commit 54dbb26b71

@ -153,14 +153,14 @@ class LoginRegisterComponent extends Component {
if (this.state.Phonenumberisnotcobool === false) { if (this.state.Phonenumberisnotcobool === false) {
if (this.state.login.length === 0) { if (this.state.login.length === 0) {
this.setState({ this.setState({
Phonenumberisnotco:"请输入正确的手机号或邮箱", Phonenumberisnotco:"请输入正确的邮箱或手机号",
}) })
return return
} }
} }
if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") { if (this.state.login === undefined|| this.state.login.length ===0 || this.state.login === "") {
this.setState({ this.setState({
Phonenumberisnotco:"请输入登录手机号码或邮箱", Phonenumberisnotco:"请输入正确的邮箱或手机号",
}) })
return return
} }
@ -173,23 +173,23 @@ class LoginRegisterComponent extends Component {
} }
if (this.state.password === undefined || this.state.password.length ===0 || this.state.password === "") { if (this.state.password === undefined || this.state.password.length ===0 || this.state.password === "") {
this.setState({ this.setState({
Phonenumberisnotcosmmm:"请输入密码", Phonenumberisnotcosmmm:"密码不能为空",
}) })
return return
} }
if (this.state.passwords === undefined || this.state.passwords.length ===0 || this.state.passwords === "") { if (this.state.passwords === undefined || this.state.passwords.length ===0 || this.state.passwords === "") {
this.setState({ this.setState({
Phonenumberisnotcosymmmm:"请输入二次密码" Phonenumberisnotcosymmmm:"二次密码不能为空"
}) })
return return
} }
if (this.state.password !== this.state.passwords==="") { if (this.state.password !== this.state.passwords==="") {
this.openNotification(`两次密码不相同`); this.openNotification(`两次输入的密码不一致`);
return return
} }
if (this.state.codes === undefined|| this.state.codes.length ===0 || this.state.codes === "") { if (this.state.codes === undefined|| this.state.codes.length ===0 || this.state.codes === "") {
this.setState({ this.setState({
Phonenumberisnotcosyzm:"请输入验证码" Phonenumberisnotcosyzm:"验证码不能为空"
}) })
return return
} }
@ -202,8 +202,29 @@ class LoginRegisterComponent extends Component {
}).then((result) => { }).then((result) => {
// console.log(result); // console.log(result);
//登录成功会生成session //登录成功会生成session
this.openNotification("找回密码成功,请重新登入。"); if(result){
window.location.href = "/login" if(result.data.status===-2){
if(result.data.message==="验证码不正确"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else if(result.data.message==="验证码已失效"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
return;
}else {
this.openNotification(result.data.message);
return;
}
}else {
this.openNotification("找回密码成功,请重新登入。");
window.location.href = "/login"
}
}
}).catch((error) => { }).catch((error) => {
}) })

@ -298,6 +298,9 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosyzm:"验证码不正确", Phonenumberisnotcosyzm:"验证码不正确",
}) })
return;
}else {
this.openNotification(result.data.message);
return; return;
} }
}else { }else {

Loading…
Cancel
Save