|
|
@ -102,6 +102,8 @@ class LoginDialog extends Component {
|
|
|
|
authCodeclass:'log-botton mt5',
|
|
|
|
authCodeclass:'log-botton mt5',
|
|
|
|
isRender: false,
|
|
|
|
isRender: false,
|
|
|
|
MyEduCoderModals:false,
|
|
|
|
MyEduCoderModals:false,
|
|
|
|
|
|
|
|
Phonenumberisnotco:undefined,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool:false,
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -112,26 +114,103 @@ class LoginDialog extends Component {
|
|
|
|
register=(num) =>{
|
|
|
|
register=(num) =>{
|
|
|
|
this.setState({login:1,speedy:num,dialogBox:'dialogBox2'});
|
|
|
|
this.setState({login:1,speedy:num,dialogBox:'dialogBox2'});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
inputOnBlur = (e, id) => {
|
|
|
|
loginChange = () =>{
|
|
|
|
this.Emailphonenumberverification(e.target.value, 1);
|
|
|
|
let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
|
|
|
|
};
|
|
|
|
let reg1 = /^1\d{10}$/;
|
|
|
|
// 输入页面
|
|
|
|
let reg2=/^[a-zA-z]\w{3,14}$/;
|
|
|
|
loginChange = (e) =>{
|
|
|
|
// let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
|
|
|
var stirngt="";
|
|
|
|
let value=this.refs.loginPassText.value;
|
|
|
|
if(e.target.value.length>0){
|
|
|
|
let valuenum= value.length;
|
|
|
|
var str= e.target.value.replace(/\s*/g,"")
|
|
|
|
if(valuenum>0){
|
|
|
|
stirngt=str;
|
|
|
|
if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){
|
|
|
|
}else{
|
|
|
|
this.setState({regular:1})
|
|
|
|
stirngt= e.target.value;
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({loginValue:value})
|
|
|
|
if (e.target.value.length === 0) {
|
|
|
|
this.setState({regular:0})
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
loginValue: stirngt,
|
|
|
|
|
|
|
|
Phonenumberisnotco:undefined,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
loginValue: stirngt,
|
|
|
|
|
|
|
|
Phonenumberisnotco:undefined,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
|
|
|
|
|
|
|
|
// let reg1 = /^1\d{10}$/;
|
|
|
|
|
|
|
|
// let reg2=/^[a-zA-z]\w{3,14}$/;
|
|
|
|
|
|
|
|
// // let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
|
|
|
|
|
|
|
// let value=this.refs.loginPassText.value;
|
|
|
|
|
|
|
|
// let valuenum= value.length;
|
|
|
|
|
|
|
|
// if(valuenum>0){
|
|
|
|
|
|
|
|
// if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){
|
|
|
|
|
|
|
|
// this.setState({regular:1})
|
|
|
|
|
|
|
|
// return
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// // this.setState({loginValue:value});
|
|
|
|
|
|
|
|
// this.setState({regular:0});
|
|
|
|
|
|
|
|
// var stirngt;
|
|
|
|
|
|
|
|
// if(value.length>0){
|
|
|
|
|
|
|
|
// var str= value.replace(/\s*/g,"")
|
|
|
|
|
|
|
|
// stirngt=str;
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// stirngt= value;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// loginValue:stirngt,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// this.setState({loginValue:value});
|
|
|
|
|
|
|
|
// var stirngt;
|
|
|
|
|
|
|
|
// if(value.length>0){
|
|
|
|
|
|
|
|
// var str= value.replace(/\s*/g,"")
|
|
|
|
|
|
|
|
// stirngt=str;
|
|
|
|
|
|
|
|
// }else{
|
|
|
|
|
|
|
|
// stirngt= value;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// this.setState({
|
|
|
|
|
|
|
|
// loginValue:stirngt,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//邮箱手机号验证
|
|
|
|
|
|
|
|
Emailphonenumberverification = (value, id) => {
|
|
|
|
|
|
|
|
var url = `/accounts/valid_email_and_phone.json`;
|
|
|
|
|
|
|
|
axios.get((url), {
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
login: value,
|
|
|
|
|
|
|
|
type: 1,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).then((result) => {
|
|
|
|
|
|
|
|
if(result){
|
|
|
|
|
|
|
|
if(result.data.status===-2){
|
|
|
|
|
|
|
|
if(result.data.message==="该手机号码或邮箱已被注册"){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Phonenumberisnotco: result.data.message,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool: true,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
Phonenumberisnotco: undefined,
|
|
|
|
|
|
|
|
Phonenumberisnotcobool: false,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({loginValue:value})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
passwordChange = () =>{
|
|
|
|
passwordChange = () =>{
|
|
|
|
let value =this.refs.passwordText.value;
|
|
|
|
let value =this.refs.passwordText.value;
|
|
|
@ -411,7 +490,7 @@ class LoginDialog extends Component {
|
|
|
|
window.location.href = url;
|
|
|
|
window.location.href = url;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,
|
|
|
|
let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco,
|
|
|
|
dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state;
|
|
|
|
dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state;
|
|
|
|
|
|
|
|
|
|
|
|
if (isRender === undefined) {
|
|
|
|
if (isRender === undefined) {
|
|
|
@ -457,11 +536,13 @@ class LoginDialog extends Component {
|
|
|
|
id="name_loggin_input"
|
|
|
|
id="name_loggin_input"
|
|
|
|
ref="loginPassText"
|
|
|
|
ref="loginPassText"
|
|
|
|
onInput={this.loginChange}
|
|
|
|
onInput={this.loginChange}
|
|
|
|
|
|
|
|
onBlur={(e) => this.inputOnBlur(e, 1)}
|
|
|
|
|
|
|
|
value={this.state.loginValue}
|
|
|
|
name="username"
|
|
|
|
name="username"
|
|
|
|
placeholder="请输入有效的手机号/邮箱号" ></input>
|
|
|
|
placeholder="请输入有效的手机号/邮箱号" ></input>
|
|
|
|
|
|
|
|
|
|
|
|
<div style={{height: '25px'}}><p className="color-orange edu-txt-left none" id="username_error_notice"
|
|
|
|
<div style={{height: '25px'}}><p className="color-orange edu-txt-left none" id="username_error_notice"
|
|
|
|
style={{display: regular==0?'none':'block'}}>请输入有效的手机号/邮箱号</p></div>
|
|
|
|
style={{display: Phonenumberisnotco===undefined?'none':'block'}}>{Phonenumberisnotco}</p></div>
|
|
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<input type="password" id="password_loggin_input"
|
|
|
|
<input type="password" id="password_loggin_input"
|
|
|
|