diff --git a/src/modules/login/EducoderLogin.js b/src/modules/login/EducoderLogin.js index 578c260cd..59e6cc628 100644 --- a/src/modules/login/EducoderLogin.js +++ b/src/modules/login/EducoderLogin.js @@ -137,9 +137,9 @@ class EducoderLogin extends Component { {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={educodernet} width="80px"/> : - this.gohome()} src={getImageUrl(this.props.mygetHelmetapi.login_logo_url)}/> + this.gohome()} width="80px" src={getImageUrl(this.props.mygetHelmetapi.login_logo_url)}/> } diff --git a/src/modules/login/LoginDialog.js b/src/modules/login/LoginDialog.js index 441975249..f00088a90 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 from 'material-ui/Dialog'; +import { notification } from 'antd'; -import Dialog, { - DialogActions, - DialogContent, - DialogContentText, - DialogTitle, -} from 'material-ui/Dialog'; -import { notification, Modal } from 'antd'; import axios from 'axios'; diff --git a/src/modules/user/LoginRegisterComponent.js b/src/modules/user/LoginRegisterComponent.js index db369458b..c2c01df75 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: "提示", @@ -209,7 +193,7 @@ class LoginRegisterComponent extends Component { }); try { this.props.Setshowbool(3); - }catch (e) { + } catch (e) { } } @@ -219,7 +203,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 +232,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 +262,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 +285,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 +296,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 +322,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 +341,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; @@ -414,14 +398,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; } @@ -452,57 +436,57 @@ class LoginRegisterComponent extends Component { // 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.pciphone === true) { if (this.state.dragOk === false) { // this.openNotification(`请拖动滑块完成验证`,2); this.setState({ - Phonenumberisnotcosytdhk:"请拖动滑块完成验证", - dragOk:false, - Whethertoverify:this.state.Whethertoverify===true?false:true, + Phonenumberisnotcosytdhk: "请拖动滑块完成验证", + dragOk: false, + Whethertoverify: this.state.Whethertoverify === true ? false : true, }) return } } - if (this.state.codes === undefined || this.state.codes == ""||this.state.codes.length===0) { + if (this.state.codes === undefined || this.state.codes == "" || this.state.codes.length === 0) { // this.openNotification(`请输入验证码`,2); this.setState({ - Phonenumberisnotcosyzm:"验证码不能为空", + Phonenumberisnotcosyzm: "验证码不能为空", }) return - } else if (this.state.passwords === undefined || this.state.passwords == "" ||this.state.passwords.length===0) { + } else if (this.state.passwords === undefined || this.state.passwords == "" || this.state.passwords.length === 0) { this.setState({ - Phonenumberisnotcosymmm:"密码不能为空", + 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位", + 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位", + Phonenumberisnotcosymmm: "密码不能超过16位", }) return } else if (this.state.Agreetotheterms === false) { - this.openNotification(`请同意服务协议条款`,2); + 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,25 +495,25 @@ 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==="验证码不正确"){ + if (result) { + if (result.data.status === -2) { + if (result.data.message === "验证码不正确") { this.setState({ - Phonenumberisnotcosyzm:"验证码不正确", + Phonenumberisnotcosyzm: "验证码不正确", }) return; - }else if(result.data.message==="验证码已失效"){ + } else if (result.data.message === "验证码已失效") { this.setState({ - Phonenumberisnotcosyzm:"验证码不正确", + Phonenumberisnotcosyzm: "验证码不正确", }) return; - }else { + } else { this.openNotification(result.data.message); return; } - }else { + } else { // this.setState({ // logins: "", // dragOk: false, @@ -559,21 +543,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 +567,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 +599,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 +625,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 +643,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 +707,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 +742,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 +773,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 +790,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 +835,129 @@ 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.StudyMakeMoney()} - className="mr3 color-grey-9 mt3 font-12">找回密码 -
- - - {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?this.state.isphone===true?

- - ———————— 快速登录 ———————— -

- this.openweixinlogin()}> - 微信登录 - - this.openqqlogin()} className={"ml10"}> - qq登录 - -
-

:

- ———————— 快速登录 ———————— -

- {/*this.openweixinlogin()}>*/} - {/*微信登录*/} - {/**/} - this.openphoneqqlogin()}> - qq登录 - -
-

:""} -
- } - - - - { - 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?

- - ———————— 快速登录 ———————— -

- this.openweixinlogin()}> - 微信登录 - - this.openqqlogin()} className={"ml10"}> - qq登录 - -
-

:

- ———————— 快速登录 ———————— -

- {/*this.openweixinlogin()}>*/} - {/*微信登录*/} - {/**/} - this.openphoneqqlogin()}> - qq登录 - -
-

:"" - } -
- } - - - - - {weixinlogin===true?:""} - {weixinlogin===true?

- this.hideweixinlogin()}>返回登录注册 -

:""} -
- -
+ } + {/* {this.props.mygetHelmetapi && this.props.mygetHelmetapi.main_site === true ? + 我已阅读并同意 + 《服务协议条款》 + : ""} */} + + + + ); } }