diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js
index 0b4044711..71b048edb 100644
--- a/public/react/src/modules/user/LoginRegisterComponent.js
+++ b/public/react/src/modules/user/LoginRegisterComponent.js
@@ -23,6 +23,9 @@ const loginInputsyl = {
class LoginRegisterComponent extends Component {
constructor(props) {
super(props)
+
+
+ //
// console.log("LoginRegisterComponent");
// console.log("29");
// console.log(props.loginstatus);
@@ -30,7 +33,6 @@ class LoginRegisterComponent extends Component {
// console.log(props.loginstatus);
this.state = {
tab:["0"],
- activeKey: 0,
classpass: "text",
// 登录
passopens: passoff,
@@ -55,6 +57,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm:undefined,
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
+ Phonenumberisnotcodmm:undefined,
Phonenumberisnotcobool: false,
Whethertoverify:false,
@@ -64,7 +67,6 @@ class LoginRegisterComponent extends Component {
// console.log(props.loginstatus);
this.state = {
tab:["1"],
- activeKey: '1',
classpass: "text",
// 登录
passopens: passoff,
@@ -90,6 +92,7 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosytdhk:undefined,
Phonenumberisnotcosyfwtk:undefined,
Phonenumberisnotcobool: false,
+ Phonenumberisnotcodmm:undefined,
Whethertoverify:false,
}
@@ -108,12 +111,10 @@ class LoginRegisterComponent extends Component {
this.state = {
tab:["0"],
}
- this.onTabChange('0');
} else if (this.props.match.url === "/register") {
this.state = {
tab:["1"],
}
- this.onTabChange('1');
}
}
@@ -129,7 +130,6 @@ class LoginRegisterComponent extends Component {
}
- ;
StudyMakeMoney = () => { // 调用父组件方法
this.props.Setshowbool(3);
// this.props.Setlogins(3);
@@ -143,8 +143,6 @@ class LoginRegisterComponent extends Component {
}
onTabChange = (activeKey) => {
console.log("onTabChange");
- // console.log(activeKey);
- // this.setState({activeKey})
}
// -------------------- LOGIN START
//下次自动登入
@@ -183,15 +181,6 @@ class LoginRegisterComponent extends Component {
//是否验证通过
dragOkCallback = () => {
console.log(this.state.logins);
- if(this.state.logins===""||this.state.logins.length===0){
- this.setState({
- Phonenumberisnotco:"账号不能为空",
- Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
- })
- return
- }
this.Emailphonenumberverification(this.state.logins, 2)
}
@@ -199,20 +188,22 @@ class LoginRegisterComponent extends Component {
//是否同意
onChange = (e) => {
-
this.setState({
Agreetotheterms: e.target.checked,
- Phonenumberisnotcosyfwtk:undefined,
})
}
//登入接口
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";
@@ -223,6 +214,40 @@ class LoginRegisterComponent extends Component {
if (response === undefined) {
return
}
+
+ if(response.data.status === -2){
+ if("该手机号尚未注册" || "该邮箱尚未注册"){
+ this.setState({
+ Phonenumberisnotco:response.data.message,
+ })
+ return;
+ }
+ else if("错误的账号或密码"){
+ this.setState({
+ Phonenumberisnotco:response.data.message,
+ })
+ return;
+ }
+ else if("违反平台使用规范,账号已被锁定"){
+ this.setState({
+ Phonenumberisnotco:response.data.message,
+ })
+
+ return;
+ }
+ else {
+ this.openNotification(response.data.message);
+ return;
+ }
+
+
+ }
+
+ if(response.data.identity === null || response.data.identity === undefined){
+ this.props.history.push("/interesse");
+ return;
+ }
+
if (response.status === 200) {
if (response.data.status === 402) {
window.location.href = response.data.url;
@@ -244,12 +269,30 @@ class LoginRegisterComponent extends Component {
}
//注册接口
postregistered = () => {
+ // if (this.state.logins === undefined || this.state.logins === "") {
+ // this.openNotification(`请输入登录手机号码或邮箱`,2);
+ //
+ // return
+ // } else if (this.state.dragOk === false) {
+ // this.openNotification(`请拖动滑块验证`,2);
+ // return
+ // } else if (this.state.codes === undefined || this.state.codes == "") {
+ // this.openNotification(`请输入验证码`,2);
+ // return
+ // } else if (this.state.passwords === undefined || this.state.passwords == "") {
+ // this.openNotification(`请输入密码`,2);
+ // return
+ // } else if (this.state.Agreetotheterms === false) {
+ // this.openNotification(`请同意服务协议条款`,2);
+ // return;
+ // }
if (this.state.logins === undefined || this.state.logins === ""||this.state.logins.length===0) {
this.setState({
Phonenumberisnotcos:"账号不能为空",
})
return
} else if (this.state.dragOk === false) {
+ // this.openNotification(`请拖动滑块完成验证`,2);
this.setState({
Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
})
@@ -265,10 +308,18 @@ class LoginRegisterComponent extends Component {
Phonenumberisnotcosymmm:"密码不能为空",
})
return
- } else if (this.state.Agreetotheterms === false) {
+ } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length<8){
this.setState({
- Phonenumberisnotcosyfwtk:"请同意服务协议条款",
+ Phonenumberisnotcosymmm:"密码不能少于8位",
})
+ return
+ } else if (this.state.passwords !==undefined &&this.state.passwords.length>0&&this.state.passwords.length>16){
+ this.setState({
+ Phonenumberisnotcosymmm:"密码不能超过16位",
+ })
+ return
+ } else if (this.state.Agreetotheterms === false) {
+ this.openNotification(`请同意服务协议条款`,2);
return;
}
var url = "/accounts/register.json";
@@ -279,18 +330,21 @@ class LoginRegisterComponent extends Component {
}).then((result) => {
if(result){
if(result.data.status===-2){
- if(response.data.message==="验证码不正确"){
+ if(result.data.message==="验证码不正确"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
- return;
- }else if(response.data.message==="验证码已失效"){
+ return;
+ }else if(result.data.message==="验证码已失效"){
this.setState({
Phonenumberisnotcosyzm:"验证码不正确",
})
- return;
+ return;
+ }else {
+ this.openNotification(result.data.message);
+ return;
}
}else {
this.setState({
@@ -493,6 +547,7 @@ class LoginRegisterComponent extends Component {
}else{
this.setState({
login: stirngt,
+ Phonenumberisnotco:undefined,
})
}
@@ -514,6 +569,7 @@ class LoginRegisterComponent extends Component {
}
this.setState({
password: stirngt,
+ Phonenumberisnotcodmm:undefined,
})
// this.setState({
// password: e.target.value
@@ -597,7 +653,6 @@ class LoginRegisterComponent extends Component {
}
render() {
const {
- activeKey,
// 登录
autoLogin,
classpass,
@@ -612,11 +667,10 @@ class LoginRegisterComponent extends Component {
dragOk,
Whethertoverify,
classpassbool,
+ Phonenumberisnotcosytdhk,
Phonenumberisnotcosyzm,
Phonenumberisnotcosymmm,
- Phonenumberisnotcosytdhk,
- Phonenumberisnotcosyfwtk,
- Phonenumberisnotcobool,
+ Phonenumberisnotcodmm,
// 注册
readAgreement,
} = this.state
@@ -681,7 +735,7 @@ class LoginRegisterComponent extends Component {
this.inputOnBlur(e, 1)}
style={{marginTop: '30px', height: '38px'}}>
@@ -695,11 +749,17 @@ class LoginRegisterComponent extends Component {
+ {
+ Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ?
+
+ {Phonenumberisnotcodmm}
+
+ :
+ }
-
+
}
-
+
{
parseInt(tab[0])==1 &&
-
{
- Phonenumberisnotcos && Phonenumberisnotcos != "" ?
+ Phonenumberisnotcos && Phonenumberisnotcos !== "" ?
{Phonenumberisnotcos}
@@ -753,7 +792,7 @@ class LoginRegisterComponent extends Component {
{
Whethertoverify===false?
@@ -764,7 +803,7 @@ class LoginRegisterComponent extends Component {
{
Whethertoverify===true?
@@ -772,8 +811,8 @@ class LoginRegisterComponent extends Component {
""
}
{
- Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk != "" ?
-
+ Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?
+
{Phonenumberisnotcosytdhk}
:
@@ -781,38 +820,44 @@ class LoginRegisterComponent extends Component {
}
-
-
-
- {
- getverificationcodes === undefined ?
-
- : getverificationcodes === true ?
-
- :
-
- }
+
+
+
+
+ {
+ getverificationcodes === undefined ?
+
+ : getverificationcodes === true ?
+
+ :
+
+ }
+
+
+ {
+ Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?
+
+ {Phonenumberisnotcosyzm}
+
+ :
+ }
- {
- Phonenumberisnotcosyzm && Phonenumberisnotcosyzm != "" ?
-
- {Phonenumberisnotcosyzm}
-
- :
- }
+
-
}>
{
- Phonenumberisnotcosymmm && Phonenumberisnotcosymmm!== "" ?
-
+ Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?
+
{Phonenumberisnotcosymmm}
- : ""
+ :
}
我已阅读并同意服务协议条款
- {
- Phonenumberisnotcosyfwtk && Phonenumberisnotcosyfwtk!== "" ?
-
- {Phonenumberisnotcosyfwtk}
-
- : ""
-
- }
-