-
- {this.props.mygetHelmetapi === null ? ""
- :
- this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.login_logo_url===null|| this.props.mygetHelmetapi.login_logo_url===undefined?
-
![]()
this.gohome()} src={educodernet}/>
- :
-
![]()
this.gohome()} src={getImageUrl(this.props.mygetHelmetapi.login_logo_url)}/>
- }
-
-
-
-
+
+
+ {
+ settings && settings.login_logo_url ?
+
![]()
this.gohome()} width="80px" src={getImageUrl(settings.login_logo_url)}/>
+ :
+
![]()
this.gohome()} src={educodernet} width="80px"/>
+ }
{
showbool === 1 ?
-
-
-
- this.Setshowbool(e)} >
-
-
-
+
+
+ this.Setshowbool(e)} >
+
:
-
-
- this.Setshowbool(e)}>
-
-
-
+
+
+ this.Setshowbool(e)}>
+
+
}
- {this.props.mygetHelmetapi === null ?
-
© {moment().year()} EduCoder
湘ICP备17009477号Trustie & IntelliDE inside.
-
:
- this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.main_site===null|| this.props.mygetHelmetapi.main_site===undefined?
-
© {moment().year()} EduCoder
湘ICP备17009477号Trustie & IntelliDE inside.
-
:this.props.mygetHelmetapi.main_site===true?
-
-
© {moment().year()} EduCoder
湘ICP备17009477号Trustie & IntelliDE inside.
-
- :""
- }
-
+
© {moment().year()} Trustie
湘ICP备17009477号Trustie & IntelliDE inside.
)
diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js
index 441975249..aebfba8c7 100644
--- a/src/modules/login/LoginDialog.js
+++ b/src/modules/login/LoginDialog.js
@@ -1,13 +1,7 @@
import React, { Component } from 'react';
-import { Redirect } from 'react-router';
-import Dialog, {
- DialogActions,
- DialogContent,
- DialogContentText,
- DialogTitle,
-} from 'material-ui/Dialog';
-import { notification, Modal } from 'antd';
+import Dialog from 'material-ui/Dialog';
+import { notification } from 'antd';
import axios from 'axios';
@@ -329,6 +323,7 @@ class LoginDialog extends Component {
return flag;
}
componentDidMount() {
+
let flag = this.IsPC(); //true为PC端,false为手机端
this.setState({
isphone: flag
@@ -478,6 +473,7 @@ class LoginDialog extends Component {
let { qqlogin, login, isGoing, isGoingValue, disabled, bottonclass, Phonenumberisnotco,
dialogBox, isRender, weixinlogin } = this.state;
+ let { settings } = this.props;
if (isRender === undefined) {
isRender = false
}
@@ -580,9 +576,9 @@ class LoginDialog extends Component {
- this.getloginurl("https://www.trustie.net/account/lost_password")}
- className="mr3 color-grey-9">找回密码
- this.getloginurl("https://www.trustie.net/login?login=false")} className="color-grey-9">注册
+ this.getloginurl(`${settings && settings.common && settings.common.lost_password}`)} className="mr3 color-grey-9">找回密码
+
+ this.getloginurl(`${settings && settings.common && settings.common.register}`)} className="color-grey-9">注册
diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js
index cc054774f..6d5b9697a 100644
--- a/src/modules/tpm/NewHeader.js
+++ b/src/modules/tpm/NewHeader.js
@@ -812,16 +812,16 @@ class NewHeader extends Component {
this.educoderlogin()} className="mr5 color-grey-6">登录
{
- settings && settings.new_course && settings.new_course.register_url &&
- 注册
+ settings && settings.common && settings.common.register &&
+ 注册
}
: user.login === "" ?
this.educoderlogin()} className="mr5 color-grey-6">登录
{
- settings && settings.new_course && settings.new_course.register_url &&
- 注册
+ settings && settings.common && settings.common.register &&
+ 注册
}
:
diff --git a/src/modules/user/LoginRegisterComponent.js b/src/modules/user/LoginRegisterComponent.js
index db369458b..a379f67e3 100644
--- a/src/modules/user/LoginRegisterComponent.js
+++ b/src/modules/user/LoginRegisterComponent.js
@@ -1,6 +1,6 @@
-import React, {Component} from 'react';
-import {setmiyah,broadcastChannelPostMessage} from 'educoder';
-import {Tabs, Input, Checkbox, Button, notification,Menu} from 'antd';
+import React, { Component } from 'react';
+import { setmiyah, broadcastChannelPostMessage } from 'educoder';
+import { Tabs, Input, Checkbox, Button, notification, Menu } from 'antd';
import passopen from '../../../src/images/login/passopen.png';
import passoff from '../../../src/images/login/passoff.png';
import axios from 'axios';
@@ -11,7 +11,7 @@ import './common.css'
import './commontwo.css'
const { TabPane } = Tabs;
const loginInputsyl = {
- "width":"434px",
+ "width": "434px",
"height": "462px",
"-webkit-box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
"box-shadow": "3px 10px 21px 0px rgba(76,76,76,0.15)",
@@ -24,15 +24,9 @@ class LoginRegisterComponent extends Component {
constructor(props) {
super(props)
-
- //
- // console.log("LoginRegisterComponent");
- // console.log("29");
- // console.log(props.loginstatus);
- if(props.loginstatus === true){
- // console.log(props.loginstatus);
+ if (props.loginstatus === true) {
this.state = {
- tab:["0"],
+ tab: ["0"],
classpass: "text",
// 登录
passopens: passoff,
@@ -53,25 +47,25 @@ class LoginRegisterComponent extends Component {
codes: "",
Phonenumberisnotco: undefined,
Phonenumberisnotcos: undefined,
- Phonenumberisnotcosyzm:undefined,
- Phonenumberisnotcosymmm:undefined,
- Phonenumberisnotcosytdhk:undefined,
- Phonenumberisnotcosyfwtk:undefined,
- Phonenumberisnotcodmm:undefined,
+ Phonenumberisnotcosyzm: undefined,
+ Phonenumberisnotcosymmm: undefined,
+ Phonenumberisnotcosytdhk: undefined,
+ Phonenumberisnotcosyfwtk: undefined,
+ Phonenumberisnotcodmm: undefined,
Phonenumberisnotcobool: false,
- Whethertoverify:false,
- pciphone:true,
- MyEduCoderModals:false,
- registered:undefined,
- Phonenumberisnotcodmms:undefined,
- weixinlogin:false,
- qqlogin:false
+ Whethertoverify: false,
+ pciphone: true,
+ MyEduCoderModals: false,
+ registered: undefined,
+ Phonenumberisnotcodmms: undefined,
+ weixinlogin: false,
+ qqlogin: false
}
}
- if(props.loginstatus === false){
+ if (props.loginstatus === false) {
// console.log(props.loginstatus);
this.state = {
- tab:["1"],
+ tab: ["1"],
classpass: "text",
// 登录
passopens: passoff,
@@ -92,25 +86,25 @@ class LoginRegisterComponent extends Component {
codes: "",
Phonenumberisnotco: undefined,
Phonenumberisnotcos: undefined,
- Phonenumberisnotcosyzm:undefined,
- Phonenumberisnotcosymmm:undefined,
- Phonenumberisnotcosytdhk:undefined,
- Phonenumberisnotcosyfwtk:undefined,
+ Phonenumberisnotcosyzm: undefined,
+ Phonenumberisnotcosymmm: undefined,
+ Phonenumberisnotcosytdhk: undefined,
+ Phonenumberisnotcosyfwtk: undefined,
Phonenumberisnotcobool: false,
- Phonenumberisnotcodmm:undefined,
- Whethertoverify:false,
- pciphone:true,
- MyEduCoderModals:false,
- registered:undefined,
- Phonenumberisnotcodmms:undefined,
- weixinlogin:false,
- qqlogin:false
+ Phonenumberisnotcodmm: undefined,
+ Whethertoverify: false,
+ pciphone: true,
+ MyEduCoderModals: false,
+ registered: undefined,
+ Phonenumberisnotcodmms: undefined,
+ weixinlogin: false,
+ qqlogin: false
}
}
}
//判断是否是手机端
- IsPC=()=> {
+ IsPC = () => {
var userAgentInfo = navigator.userAgent;
var Agents = ["Android", "iPhone",
"SymbianOS", "Windows Phone",
@@ -124,58 +118,48 @@ class LoginRegisterComponent extends Component {
}
return flag;
}
-// 点击表单后,改变type
+ // 点击表单后,改变type
changeType = () => {
- this.setState({classpass: 'password'});
+ this.setState({ classpass: 'password' });
+ }
+ IsPC = () => {
+ var userAgentInfo = navigator.userAgent;
+ var Agents = ["Android", "iPhone",
+ "SymbianOS", "Windows Phone",
+ "iPad", "iPod"];
+ var flag = true;
+ for (var v = 0; v < Agents.length; v++) {
+ if (userAgentInfo.indexOf(Agents[v]) > 0) {
+ flag = false;
+ break;
+ }
+ }
+ return flag;
}
- IsPC=()=>{
- var userAgentInfo = navigator.userAgent;
- var Agents = ["Android", "iPhone",
- "SymbianOS", "Windows Phone",
- "iPad", "iPod"];
- var flag = true;
- for (var v = 0; v < Agents.length; v++) {
- if (userAgentInfo.indexOf(Agents[v]) > 0) {
- flag = false;
- break;
- }
- }
- return flag;
- }
componentDidMount = () => {
- let flag = this.IsPC(); //true为PC端,false为手机端
- this.setState({
- isphone:flag
- })
- // console.log("componentDidUpdate");
- // console.log(this.props);
- let pcipns=this.IsPC();
+ let flag = this.IsPC(); //true为PC端,false为手机端
+ this.setState({
+ isphone: flag
+ })
+ let pcipns = this.IsPC();
if (this.props.match.url === "/login") {
- // this.state = {
- // tab:["0"],
- //
- // }
this.setState({
- tab:["0"]
+ tab: ["0"]
})
} else if (this.props.match.url === "/register") {
- // this.state = {
- // tab:["1"],
- //
- // }
this.setState({
- tab:["1"]
+ tab: ["1"]
})
}
this.setState({
- pciphone:pcipns,
+ pciphone: pcipns,
})
}
- openNotification = (messge,type) => {
+ openNotification = (messge, type) => {
// type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色
notification.open({
message: "提示",
@@ -198,8 +182,6 @@ class LoginRegisterComponent extends Component {
StudyMakeMoney = () => { // 调用父组件方法
-
- // this.props.Setlogins(3);
this.setState({
login: "",
password: "",
@@ -209,7 +191,7 @@ class LoginRegisterComponent extends Component {
});
try {
this.props.Setshowbool(3);
- }catch (e) {
+ } catch (e) {
}
}
@@ -219,7 +201,7 @@ class LoginRegisterComponent extends Component {
// -------------------- LOGIN START
//下次自动登入
onAutoLoginChange = (e) => {
- this.setState({autoLogin: e.target.checked})
+ this.setState({ autoLogin: e.target.checked })
}
// -------------------- LOGIN END
@@ -248,19 +230,19 @@ class LoginRegisterComponent extends Component {
}
// -------------------- REGISTER START
onReadAgreementChange = (e) => {
- this.setState({readAgreement: e.target.checked})
+ this.setState({ readAgreement: e.target.checked })
}
//是否验证通过
dragOkCallback = () => {
this.setState({
- Phonenumberisnotcosytdhk:undefined,
+ Phonenumberisnotcosytdhk: undefined,
})
if (this.state.logins.length === 0) {
this.setState({
- Phonenumberisnotcos:"账号不能为空",
+ Phonenumberisnotcos: "账号不能为空",
Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
@@ -278,14 +260,14 @@ class LoginRegisterComponent extends Component {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
- dragOk:true,
+ dragOk: true,
})
} else {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
- dragOk:true,
+ dragOk: true,
});
this.Emailphonenumberverification(this.state.logins, 2);
return
@@ -301,8 +283,8 @@ class LoginRegisterComponent extends Component {
this.setState({
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
});
@@ -312,14 +294,14 @@ class LoginRegisterComponent extends Component {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
- dragOk:true,
+ dragOk: true,
})
this.Emailphonenumberverification(this.state.logins, 2);
return
}
this.setState({
- Phonenumberisnotcosytdhk:undefined,
+ Phonenumberisnotcosytdhk: undefined,
})
this.Emailphonenumberverification(this.state.logins, 2)
@@ -338,12 +320,12 @@ class LoginRegisterComponent extends Component {
if (this.state.login === undefined || this.state.login == "") {
this.setState({
- Phonenumberisnotco:"账号不能为空",
+ Phonenumberisnotco: "账号不能为空",
})
return
} else if (this.state.password === undefined || this.state.password == "") {
this.setState({
- Phonenumberisnotcodmm:"密码不能为空",
+ Phonenumberisnotcodmm: "密码不能为空",
})
return
}
@@ -357,38 +339,38 @@ class LoginRegisterComponent extends Component {
return
}
- if(response.data.status === -2){
- if(response.data.message==="该手机号尚未注册" || response.data.message==="该邮箱尚未注册"){
+ if (response.data.status === -2) {
+ if (response.data.message === "该手机号尚未注册" || response.data.message === "该邮箱尚未注册") {
this.setState({
- Phonenumberisnotco:response.data.message,
+ Phonenumberisnotco: response.data.message,
})
return;
}
- else if(response.data.message==="错误的账号或密码"){
+ else if (response.data.message === "错误的账号或密码") {
this.setState({
- Phonenumberisnotcodmms:response.data.message,
+ Phonenumberisnotcodmms: response.data.message,
})
return;
}
- else if(response.data.message==="违反平台使用规范,账号已被锁定"){
+ else if (response.data.message === "违反平台使用规范,账号已被锁定") {
this.setState({
- Phonenumberisnotco:response.data.message,
+ Phonenumberisnotco: response.data.message,
})
return;
} else if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") {
const messge = (
-
-
- 登录密码出错已达上限,账号已被锁定;
+
+
+ 登录密码出错已达上限,账号已被锁定;
-
- 请10分钟后重新登录或找回密码
-
-
+
+ 请10分钟后重新登录或找回密码
+
+
)
this.openNotifications(messge);
return;
@@ -400,11 +382,6 @@ class LoginRegisterComponent extends Component {
}
- // if(response.data.profile_completed !== null || response.data.profile_completed === false){
- // this.setMyEduCoderModals();
- // return;
- // }
-
if (response.status === 200) {
if (response.data.status === 402) {
window.location.href = response.data.url;
@@ -414,14 +391,14 @@ class LoginRegisterComponent extends Component {
isRender: false
})
var weekArray = JSON.parse(window.sessionStorage.getItem('yslgeturls'));
- if(weekArray===undefined){
- weekArray="/";
+ if (weekArray === undefined) {
+ weekArray = "/";
}
- if(weekArray===null){
- weekArray="/";
+ if (weekArray === null) {
+ weekArray = "/";
}
- if(weekArray==="null"){
- weekArray="/";
+ if (weekArray === "null") {
+ weekArray = "/";
}
window.location.href = weekArray;
}
@@ -435,74 +412,37 @@ 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) {
+ if (this.state.logins === undefined || this.state.logins === "" || this.state.logins.length === 0) {
this.setState({
- Phonenumberisnotcos:"账号不能为空",
+ Phonenumberisnotcos: "账号不能为空",
Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
return
}
- if(this.state.pciphone===true){
- if (this.state.dragOk === false) {
- // this.openNotification(`请拖动滑块完成验证`,2);
- this.setState({
- Phonenumberisnotcosytdhk:"请拖动滑块完成验证",
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
- })
- return
- }
- }
- if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) {
- // this.openNotification(`请输入验证码`,2);
+ if (this.state.passwords === undefined || this.state.passwords == "" || this.state.passwords.length === 0) {
this.setState({
- Phonenumberisnotcosyzm:"验证码不能为空",
+ Phonenumberisnotcosymmm: "密码不能为空",
})
return
- } else if (this.state.passwords === undefined || this.state.passwords == "" ||this.state.passwords.length===0) {
+ } else if (this.state.passwords !== undefined && this.state.passwords.length > 0 && this.state.passwords.length < 8) {
this.setState({
- Phonenumberisnotcosymmm:"密码不能为空",
+ Phonenumberisnotcosymmm: "密码不能少于8位",
})
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 > 16) {
this.setState({
- Phonenumberisnotcosymmm:"密码不能少于8位",
+ Phonenumberisnotcosymmm: "密码不能超过16位",
})
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;
}
let url;
- if(this.props.weixinlogin){
- url= '/weapps/register.json';
- }else{
+ if (this.props.weixinlogin) {
+ url = '/weapps/register.json';
+ } else {
url = "/accounts/register.json";
}
@@ -511,34 +451,9 @@ class LoginRegisterComponent extends Component {
password: this.state.passwords,
code: this.state.codes,
}).then((result) => {
- if(result){
- 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.setState({
- // logins: "",
- // dragOk: false,
- // codes: "",
- // passwords: "",
- // Agreetotheterms: "",
- // })
- this.setMyEduCoderModals();
- }
+ if (result && result.data) {
+ this.openNotification("注册成功!");
+ this.props.history.push('/');
}
}).catch((error) => {
@@ -559,21 +474,21 @@ class LoginRegisterComponent extends Component {
// console.log(result);
// this.setState({dragOk: true})
- if(result){
- if(result.data.status===-2){
+ if (result) {
+ if (result.data.status === -2) {
if (id === 1) {
- if(result.data.message==="该手机号码或邮箱已被注册"){
+ if (result.data.message === "该手机号码或邮箱已被注册") {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
- dragOk:true,
+ dragOk: true,
})
- }else {
+ } else {
this.setState({
Phonenumberisnotco: result.data.message,
Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
@@ -583,26 +498,26 @@ class LoginRegisterComponent extends Component {
this.setState({
Phonenumberisnotcos: result.data.message,
Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
return;
}
- }else {
+ } else {
if (id === 1) {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
- dragOk:true,
+ dragOk: true,
})
return;
} else if (id === 2) {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
- dragOk:true,
+ dragOk: true,
})
return;
}
@@ -615,20 +530,20 @@ class LoginRegisterComponent extends Component {
};
//短信验证
SMSverification = () => {
- let logins=this.state.logins;
+ let logins = this.state.logins;
var url = `/accounts/get_verification_code.json`;
axios.get((url), {
params: {
login: this.state.logins,
type: 1,
- smscode:setmiyah(logins)
+ smscode: setmiyah(logins)
}
}).then((result) => {
//验证有问题{"status":1,"message":"success"}
// console.log(result);
- if(result.data.status===1){
+ if (result.data.status === 1) {
this.openNotification("验证码已发送,请注意查收");
- }else if(result.data.status===-2){
+ } else if (result.data.status === -2) {
this.openNotification(result.data.message);
}
}).catch((error) => {
@@ -641,13 +556,13 @@ class LoginRegisterComponent extends Component {
if (this.state.classpassbool === true) {
this.setState({
- passopens:passoff ,
+ passopens: passoff,
classpass: "text",
classpassbool: false,
})
} else {
this.setState({
- passopens: passopen ,
+ passopens: passopen,
classpass: "password",
classpassbool: true,
})
@@ -659,19 +574,19 @@ class LoginRegisterComponent extends Component {
getverificationcode = () => {
// console.log(this.state.Phonenumberisnotcobool);
// console.log(this.state.dragOk);
- if(this.state.logins === undefined || this.state.logins.length===0){
+ if (this.state.logins === undefined || this.state.logins.length === 0) {
this.openNotification("请输入手机号或邮箱");
return;
}
//这是判断是否手机正确
- if(this.state.Phonenumberisnotcobool === true){
+ if (this.state.Phonenumberisnotcobool === true) {
this.openNotification(this.state.Phonenumberisnotcos);
this.setState({
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
return;
}
- if(this.state.pciphone===true) {
+ if (this.state.pciphone === true) {
if (this.state.dragOk === false) {
this.openNotification("请拖动滑块验证");
return;
@@ -723,25 +638,25 @@ class LoginRegisterComponent extends Component {
loginInputonChange = (e) => {
// console.log(e.target.value);
var stirngt;
- if(e.target.value.length>0){
- var str= e.target.value.replace(/\s*/g,"")
- stirngt=str;
- }else{
- stirngt= e.target.value;
+ if (e.target.value.length > 0) {
+ var str = e.target.value.replace(/\s*/g, "")
+ stirngt = str;
+ } else {
+ stirngt = e.target.value;
}
if (e.target.value.length === 0) {
this.setState({
Phonenumberisnotco: undefined,
Phonenumberisnotcobool: false,
- Phonenumberisnotcodmms:undefined,
+ Phonenumberisnotcodmms: undefined,
login: stirngt,
})
- }else{
+ } else {
this.setState({
login: stirngt,
- Phonenumberisnotco:undefined,
- Phonenumberisnotcodmms:undefined,
+ Phonenumberisnotco: undefined,
+ Phonenumberisnotcodmms: undefined,
})
}
@@ -758,20 +673,17 @@ class LoginRegisterComponent extends Component {
})
return;
}
- // var telephone = $("#telephoneAdd.tianjia_phone").val();
var regph = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
- // var email = $("#add_email.tianjia_email").val();
var regemail = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
- // [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(e.target.value)) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
} else {
this.setState({
@@ -792,8 +704,8 @@ class LoginRegisterComponent extends Component {
this.setState({
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: true,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
return
} else {
@@ -809,47 +721,43 @@ class LoginRegisterComponent extends Component {
}
//获取登入密码
passwordonChange = (e) => {
- // console.log(e.target.value);
var stirngt;
- if(e.target.value.length>0){
- var str= e.target.value.replace(/\s*/g,"")
- stirngt=str;
- }else{
- stirngt= e.target.value;
+ if (e.target.value.length > 0) {
+ var str = e.target.value.replace(/\s*/g, "")
+ stirngt = str;
+ } else {
+ stirngt = e.target.value;
}
this.setState({
password: stirngt,
- Phonenumberisnotcodmm:undefined,
- Phonenumberisnotcodmms:undefined,
+ Phonenumberisnotcodmm: undefined,
+ Phonenumberisnotcodmms: undefined,
})
- // this.setState({
- // password: e.target.value
- // })
}
//获取注册登入
loginInputonChanges = (e) => {
var stirngt;
- if(e.target.value.length>0){
- var str= e.target.value.replace(/\s*/g,"")
- stirngt=str;
- }else{
- stirngt= e.target.value;
+ if (e.target.value.length > 0) {
+ var str = e.target.value.replace(/\s*/g, "")
+ stirngt = str;
+ } else {
+ stirngt = e.target.value;
}
if (e.target.value.length === 0) {
this.setState({
Phonenumberisnotcos: undefined,
Phonenumberisnotcobool: false,
logins: stirngt,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
- }else{
+ } else {
this.setState({
logins: stirngt,
Phonenumberisnotcos: undefined,
- dragOk:false,
- Whethertoverify:this.state.Whethertoverify===true?false:true,
+ dragOk: false,
+ Whethertoverify: this.state.Whethertoverify === true ? false : true,
})
}
@@ -858,449 +766,123 @@ class LoginRegisterComponent extends Component {
passwordonChanges = (e) => {
// console.log(e.target.value);
var stirngt;
- if(e.target.value.length>0){
- var str= e.target.value.replace(/\s*/g,"")
- stirngt=str;
- }else{
- stirngt= e.target.value;
+ if (e.target.value.length > 0) {
+ var str = e.target.value.replace(/\s*/g, "")
+ stirngt = str;
+ } else {
+ stirngt = e.target.value;
}
this.setState({
passwords: stirngt,
- Phonenumberisnotcosymmm:undefined,
+ Phonenumberisnotcosymmm: undefined,
})
}
//获取code
codesonChange = (e) => {
this.setState({
codes: e.target.value,
- Phonenumberisnotcosyzm:undefined,
+ Phonenumberisnotcosyzm: undefined,
})
}
//切换tab
- changeTab=(e)=>{
+ changeTab = (e) => {
this.setState({
- tab:e.key
+ tab: e.key
})
-
- if(e.key === 0){
+ if (e.key === 0) {
this.setState({
- Phonenumberisnotcos:undefined
+ Phonenumberisnotcos: undefined
})
- }else{
+ } else {
this.setState({
- Phonenumberisnotco:undefined
+ Phonenumberisnotco: undefined
})
-
}
-
- // this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/student_exercise_list?tab=`+e.key)
-
}
- loginonkeyup =(e)=>{
- if(e.keyCode==32){
-
- return false;
- }
- };
- setNotcompleteds=()=>{
+ setMyEduCoderModals = () => {
this.setState({
- Notcompleteds:true,
- MyEduCoderModals:false,
- registered:undefined,
-
- })
- };
- setMyEduCoderModals=()=>{
- this.setState({
- MyEduCoderModals:true,
- registered:"注册成功"
+ MyEduCoderModals: true,
+ registered: "注册成功"
})
};
- openweixinlogin=()=>{
- this.setState({
- weixinlogin:true
- })
- }
- hideweixinlogin=()=>{
- this.setState({
- weixinlogin:false,
- qqlogin:false,
- tab:["0"]
- })
- }
-
- openqqlogin=()=>{
- this.setState({
- qqlogin:true
- })
- //window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code`
- window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code`
- // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code`
- }
-
- openphoneqqlogin=()=>{
- window.open(
- `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginqq&state=null,${window.location.host}&response_type=code`
- )
- }
render() {
- const {
- // 登录
- autoLogin,
- classpass,
- passopens,
- seconds,
- getverificationcodes,
- Agreetotheterms,
- Phonenumberisnotco,
- Phonenumberisnotcos,
- codes,
- tab,
- dragOk,
- Whethertoverify,
- classpassbool,
- Phonenumberisnotcosytdhk,
- Phonenumberisnotcosyzm,
- Phonenumberisnotcosymmm,
- Phonenumberisnotcodmm,
- // 注册
- readAgreement,
- pciphone,
- Phonenumberisnotcodmms,
- weixinlogin
- } = this.state
- // height: 346px;
- if (this.state.seconds === 0) {
- // window.location.href='http://www.cnblogs.com/a-cat/';
- }
-
-
+ const {passopens,Agreetotheterms,Phonenumberisnotcos,tab,classpassbool,Phonenumberisnotcosymmm} = this.state
return (
-
-
-
+ }
+
-
- {weixinlogin===false&&this.props.weixinlogin===undefined?
:""}
-
- {
- weixinlogin===false&&parseInt(tab[0])==0 &&
-
-
-
-
this.inputOnBlur(e, 1)}
- style={{marginTop: '30px', height: '38px'}}
- onPressEnter={() => this.postLogin()}
- >
-
- {
- Phonenumberisnotco && Phonenumberisnotco != "" ?
-
- {Phonenumberisnotco}
-
- :
- }
-
-
this.postLogin()}
- className={Phonenumberisnotcodmm && Phonenumberisnotcodmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
- placeholder="密码">
- {
- Phonenumberisnotcodmm && Phonenumberisnotcodmm != "" ?
-
- {Phonenumberisnotcodmm}
-
- : (Phonenumberisnotcodmms=== undefined?
:"")
- }
- {
- Phonenumberisnotcodmms && Phonenumberisnotcodmms != "" ?
-
- {Phonenumberisnotcodmms}
-
- : ""
- }
-
-
-
-
- {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?this.state.isphone===true?
-
- ———————— 快速登录 ————————
-
- :
- ———————— 快速登录 ————————
-
- :""}
-
- }
-
-
-
- {
- weixinlogin===false&&parseInt(tab[0])==1 &&
-
-
this.inputOnBlurzhuche(e, 2)}
- style={{marginTop: '30px' , height: '38px',color:'#999999',fontSize:"14px"}}>
- {
- Phonenumberisnotcos && Phonenumberisnotcos !== "" ?
-
- {Phonenumberisnotcos}
-
- :
-
- }
- {this.state.MyEduCoderModals===true?
{this.setNotcompleteds()}}
- />:""}
-
- {
- Whethertoverify===false&&pciphone===true?
-
-
- :
- ""
-
- }
- {
- Whethertoverify===true&&pciphone===true?
-
-
- :
- ""
- }
-
-
- {
- pciphone===true?
- (
- Phonenumberisnotcosytdhk && Phonenumberisnotcosytdhk !== "" ?
-
- {Phonenumberisnotcosytdhk}
-
- :
-
- )
- :""
- }
-
-
-
-
-
-
-
-
- {
- getverificationcodes === undefined ?
-
- : getverificationcodes === true ?
-
- :
-
- }
-
-
-
- {
- Phonenumberisnotcosyzm && Phonenumberisnotcosyzm !== "" ?
-
- {Phonenumberisnotcosyzm}
-
- :
-
- }
-
-
-
-
-
- this.Showandhide(key)}>
-
- }>
- {
- Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?
-
- {Phonenumberisnotcosymmm}
+ }
+ `
+ }
+
+ this.Showandhide(key)}>
+
+ }>
+ {
+ Phonenumberisnotcosymmm && Phonenumberisnotcosymmm !== "" ?
+
+ {Phonenumberisnotcosymmm}
- :
+ :
- }
- {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?我已阅读并同意
-
- 《服务协议条款》
- :""}
-
-
- {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?this.state.isphone===true?
-
- ———————— 快速登录 ————————
-
- :
- ———————— 快速登录 ————————
-
- :""
- }
-
- }
-
-
-
-
- {weixinlogin===true?
:""}
- {weixinlogin===true?
- this.hideweixinlogin()}>返回登录注册
-
:""}
-
-
-
+ }
+
+