dev_forum
杨树林 5 years ago
parent c364349eca
commit 8c0fd05b75

@ -193,23 +193,23 @@ class LoginRegisterComponent extends Component {
this.openNotification(`两次输入的密码不一致`); this.openNotification(`两次输入的密码不一致`);
return 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({ this.setState({
Phonenumberisnotcosmmm:"密码不能少于8位", Phonenumberisnotcosmmm:"密码不能少于8位",
}) })
return 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({ this.setState({
Phonenumberisnotcosmmm:"密码不能超过16位", Phonenumberisnotcosmmm:"密码不能超过16位",
}) })
return 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({ this.setState({
Phonenumberisnotcosymmmm:"二次密码不能少于8位", Phonenumberisnotcosymmmm:"二次密码不能少于8位",
}) })
return 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({ this.setState({
Phonenumberisnotcosymmmm:"二次密码不能超过16位", Phonenumberisnotcosymmmm:"二次密码不能超过16位",
}) })
@ -297,6 +297,7 @@ class LoginRegisterComponent extends Component {
} }
this.setState({ this.setState({
password: stirngt, password: stirngt,
Phonenumberisnotcosmmm:undefined,
}) })
} }
@ -311,13 +312,15 @@ class LoginRegisterComponent extends Component {
} }
this.setState({ this.setState({
passwords: stirngt, passwords: stirngt,
Phonenumberisnotcosymmmm:undefined,
}) })
} }
//获取code //获取code
codesonChange = (e) => { codesonChange = (e) => {
this.setState({ this.setState({
codes: e.target.value codes: e.target.value,
Phonenumberisnotcosyzm:undefined,
}) })
} }
inputOnBlur = (e) => { inputOnBlur = (e) => {
@ -388,6 +391,9 @@ class LoginRegisterComponent extends Component {
}) })
return return
} }
this.setState({
Phonenumberisnotcosytdhk:undefined,
})
this.Emailphonenumberverification(this.state.login) this.Emailphonenumberverification(this.state.login)
} }
@ -520,7 +526,7 @@ class LoginRegisterComponent extends Component {
</style> </style>
{/*onBlur={(e) => this.inputOnBlur(e)}*/} {/*onBlur={(e) => this.inputOnBlur(e)}*/}
<Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey} <Input style={loginInputsyl} type="text" autoComplete="off" onClick={this.changeTypey}
className={"loginInputzhuche"} className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="输入注册手机号或邮箱" value={this.state.login} placeholder="输入注册手机号或邮箱" value={this.state.login}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input> onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{ {
@ -560,7 +566,7 @@ class LoginRegisterComponent extends Component {
: <div style={{height: "25px"}}></div> : <div style={{height: "25px"}}></div>
} }
<Input type={classpass} <Input type={classpass}
className={"loginInputzhuche"} className={Phonenumberisnotcosmmm && Phonenumberisnotcosmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges} onClick={this.changeType} autoComplete="new-password" onChange={this.loginInputonChanges}
value={this.state.password} style={{width: "100%", height: "38px"}} value={this.state.password} style={{width: "100%", height: "38px"}}
placeholder="输入8~16位密码区分大小写"></Input> placeholder="输入8~16位密码区分大小写"></Input>
@ -573,7 +579,7 @@ class LoginRegisterComponent extends Component {
} }
<Input type={classpass} <Input type={classpass}
className={"loginInputzhuche"} className={Phonenumberisnotcosymmmm && Phonenumberisnotcosymmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password" onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords} onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height: "38px", width: "100%"}} style={{height: "38px", width: "100%"}}
@ -586,7 +592,9 @@ class LoginRegisterComponent extends Component {
: <div style={{height: "25px"}}></div> : <div style={{height: "25px"}}></div>
} }
<div className="yslbutondls"> <div className="yslbutondls">
<Input className=" mr5 loginInputzhuche" type="text" autoComplete="off" style={{
<Input className={Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?" mr5 font-14 color-grey-9 loginInputzhucheyslass bor-reds":" mr5 font-14 color-grey-9 loginInputzhuche"}
type="text" autoComplete="off" style={{
width: "210px", width: "210px",
height: "38px", height: "38px",
}} placeholder="请输入验证码" }} placeholder="请输入验证码"

@ -57,6 +57,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm:undefined, Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined, Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined, Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcodmm:undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
Whethertoverify:false, Whethertoverify:false,
@ -91,6 +92,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosytdhk:undefined, Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined, Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcobool: false, Phonenumberisnotcobool: false,
Phonenumberisnotcodmm:undefined,
Whethertoverify:false, Whethertoverify:false,
} }
@ -194,10 +196,14 @@ class LoginRegisterComponent extends Component {
//登入接口 //登入接口
postLogin = () => { postLogin = () => {
if (this.state.login === undefined || this.state.login == "") { if (this.state.login === undefined || this.state.login == "") {
this.openNotification(`请输入登录手机号码或邮箱`,2); this.setState({
Phonenumberisnotco:"账号不能为空",
})
return return
} else if (this.state.password === undefined || this.state.password == "") { } else if (this.state.password === undefined || this.state.password == "") {
this.openNotification(`请输入密码`,2); this.setState({
Phonenumberisnotcodmm:"密码不能为空",
})
return return
} }
var url = "/accounts/login.json"; var url = "/accounts/login.json";
@ -208,6 +214,34 @@ class LoginRegisterComponent extends Component {
if (response === undefined) { if (response === undefined) {
return 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.status === 200) {
if (response.data.status === 402) { if (response.data.status === 402) {
window.location.href = response.data.url; window.location.href = response.data.url;
@ -268,12 +302,12 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm:"密码不能为空", Phonenumberisnotcosymmm:"密码不能为空",
}) })
return 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({ this.setState({
Phonenumberisnotcosymmm:"密码不能少于8位", Phonenumberisnotcosymmm:"密码不能少于8位",
}) })
return 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({ this.setState({
Phonenumberisnotcosymmm:"密码不能超过16位", Phonenumberisnotcosymmm:"密码不能超过16位",
}) })
@ -507,6 +541,7 @@ class LoginRegisterComponent extends Component {
}else{ }else{
this.setState({ this.setState({
login: stirngt, login: stirngt,
Phonenumberisnotco:undefined,
}) })
} }
@ -528,6 +563,7 @@ class LoginRegisterComponent extends Component {
} }
this.setState({ this.setState({
password: stirngt, password: stirngt,
Phonenumberisnotcodmm:undefined,
}) })
// this.setState({ // this.setState({
// password: e.target.value // password: e.target.value
@ -628,6 +664,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosytdhk, Phonenumberisnotcosytdhk,
Phonenumberisnotcosyzm, Phonenumberisnotcosyzm,
Phonenumberisnotcosymmm, Phonenumberisnotcosymmm,
Phonenumberisnotcodmm,
// 注册 // 注册
readAgreement, readAgreement,
} = this.state } = this.state
@ -692,7 +729,7 @@ class LoginRegisterComponent extends Component {
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login} <Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange} onChange={this.loginInputonChange}
name="username" name="username"
className="font-14 color-grey-9 loginInputzhuche" className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onBlur={(e) => this.inputOnBlur(e, 1)} onBlur={(e) => this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}></Input> style={{marginTop: '30px', height: '38px'}}></Input>
@ -706,11 +743,17 @@ class LoginRegisterComponent extends Component {
<Input type="password" name="password" id="password" value={this.state.password} <Input type="password" name="password" id="password" value={this.state.password}
onChange={this.passwordonChange} onChange={this.passwordonChange}
className="font-14 color-grey-9 loginInputzhuche" className={Phonenumberisnotcodmm && Phonenumberisnotcodmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
placeholder="密码"></Input> placeholder="密码"></Input>
{
Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>{Phonenumberisnotcodmm}</span>
</p>
: <div style={{height:"25px"}}></div>
}
<div className="left_right mt25 font-12 " style={{color: '#676767'}}> <div className="left_right font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox> <Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a onClick={()=>this.StudyMakeMoney()} <a onClick={()=>this.StudyMakeMoney()}

Loading…
Cancel
Save