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

@ -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 {
</style>
{/*onBlur={(e) => this.inputOnBlur(e)}*/}
<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}
onChange={this.loginInputonChange} style={{marginTop: '10px', height: "38px"}}></Input>
{
@ -560,7 +566,7 @@ class LoginRegisterComponent extends Component {
: <div style={{height: "25px"}}></div>
}
<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}
value={this.state.password} style={{width: "100%", height: "38px"}}
placeholder="输入8~16位密码区分大小写"></Input>
@ -573,7 +579,7 @@ class LoginRegisterComponent extends Component {
}
<Input type={classpass}
className={"loginInputzhuche"}
className={Phonenumberisnotcosymmmm && Phonenumberisnotcosymmmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
onClick={this.changeType} autoComplete="new-password"
onChange={this.loginInputonChangess} value={this.state.passwords}
style={{height: "38px", width: "100%"}}
@ -586,7 +592,9 @@ class LoginRegisterComponent extends Component {
: <div style={{height: "25px"}}></div>
}
<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",
height: "38px",
}} placeholder="请输入验证码"

@ -57,6 +57,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcodmm:undefined,
Phonenumberisnotcobool: false,
Whethertoverify:false,
@ -91,6 +92,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcobool: false,
Phonenumberisnotcodmm:undefined,
Whethertoverify:false,
}
@ -194,10 +196,14 @@ class LoginRegisterComponent extends Component {
//登入接口
postLogin = () => {
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 {
<Input placeholder="请输入登录手机号码或邮箱" value={this.state.login}
onChange={this.loginInputonChange}
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)}
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}
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>
{
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>
<a onClick={()=>this.StudyMakeMoney()}

Loading…
Cancel
Save