From 7c49d453a991486e2b5aedfddd5bdf496bc2282b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 7 Nov 2019 10:42:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/LoginDialog.js | 82 ++++++++++++++----- public/react/src/modules/tpm/NewHeader.js | 7 +- .../modules/user/LoginRegisterComponent.js | 37 +++++++-- 3 files changed, 97 insertions(+), 29 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 1fa52670e..6779bb498 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -476,10 +476,28 @@ class LoginDialog extends Component { if (response.data.status === 402) { // window.location.href = response.data.url; }else if (response.data.status === -2) { - notification.open({ - message: '提示', - description:response.data.message, - }); + if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") { + const messge = ( +
+

+ 登录密码出错已达上限,账号已被锁定; +

+

+ 请10分钟后重新登录或找回密码 +

+
+ ) + this.openNotifications(messge); + } else { + notification.open({ + message: '提示', + description: response.data.message, + duration: 5, + }); + } }else{ @@ -529,6 +547,17 @@ class LoginDialog extends Component { weixinlogin:true }) } + openNotifications = (btn) => { + // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 + notification.open({ + message: "提示", + description: btn, + duration: 5, + onClick: () => { + + }, + }); + } openqqlogin=()=>{ this.setState({ qqlogin:true @@ -543,7 +572,7 @@ class LoginDialog extends Component { `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%2ftest-newweb.educoder.net%2fotherloginqq&response_type=code` ) } - + hideweixinlogin=()=>{ this.setState({ weixinlogin:false, @@ -605,27 +634,37 @@ class LoginDialog extends Component { this.inputOnBlur(e, 1)} - value={this.state.loginValue} - name="username" - placeholder="请输入有效的手机号/邮箱号" > + type="text" + className="input-100-45 mt20" + id="name_loggin_input" + ref="loginPassText" + onInput={this.loginChange} + onBlur={(e) => this.inputOnBlur(e, 1)} + onPressEnter={disabled === false ? + this.loginEDU : () => { + } + // console.log(1) + } + value={this.state.loginValue} + name="username" + placeholder="请输入有效的手机号/邮箱号" >

{Phonenumberisnotco}

+ name="password" + ref="passwordText" + onInput={this.passwordChange} + onKeyDown={this.onKeydowns} + className="input-100-45 mt5" + onPressEnter={disabled === false ? + this.loginEDU : () => { + } + // console.log(1) + } + placeholder="密码" >

@@ -662,7 +701,8 @@ class LoginDialog extends Component { - this.getloginurl("/changepassword")} className="mr3 color-grey-9">忘记密码 + this.getloginurl("/changepassword")} + className="mr3 color-grey-9">找回密码 this.getloginurl("/register")} className="color-grey-9">注册 diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index c9dc518b0..61b20c01f 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -698,7 +698,7 @@ submittojoinclass=(value)=>{ } document.head.appendChild(link); } - + getAppdata=()=>{ let url = "/setting.json"; axios.get(url).then((response) => { @@ -1226,8 +1226,8 @@ submittojoinclass=(value)=>{ this.props.Headertop && this.props.Headertop.laboratory_user &&

  • 后台管理
  • } - -
  • 账号管理
  • + +
  • 账号管理
  • {/*
  • this.educoderlogin()} >登入测试接口
  • */} {/*
  • this.trialapplications()} >试用申请
  • */} {/*
  • 兴趣页
  • */} @@ -1235,6 +1235,7 @@ submittojoinclass=(value)=>{
  • {/*退出*/} {/*this.educoderlogin()}>退出*/} + this.educoderlogin()} className="mr5 color-white">登录 this.educoderloginysl()}>退出
  • diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 10783655e..41954a3fb 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -183,12 +183,21 @@ class LoginRegisterComponent extends Component { notification.open({ message: "提示", description: messge, - duration: 0, onClick: () => { console.log('Notification Clicked12312313123!'); }, }); } + openNotifications = (btn) => { + // type 1 成功提示绿色 2提醒颜色黄色 3错误提示红色 + notification.open({ + message: "提示", + description: btn, + onClick: () => { + + }, + }); + } StudyMakeMoney = () => { // 调用父组件方法 @@ -370,8 +379,23 @@ class LoginRegisterComponent extends Component { }) return; - } - else { + } else if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") { + const messge = ( +
    +

    + 登录密码出错已达上限,账号已被锁定; +

    +

    + 请10分钟后重新登录或找回密码 +

    +
    + ) + this.openNotifications(messge); + return; + } else { this.openNotification(response.data.message); return; } @@ -1013,7 +1037,9 @@ class LoginRegisterComponent extends Component { name="username" className={Phonenumberisnotco && Phonenumberisnotco !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"} onBlur={(e) => this.inputOnBlur(e, 1)} - style={{marginTop: '30px', height: '38px'}}> + style={{marginTop: '30px', height: '38px'}} + onPressEnter={() => this.postLogin()} + > { Phonenumberisnotco && Phonenumberisnotco != "" ? @@ -1023,8 +1049,9 @@ class LoginRegisterComponent extends Component { :
    } - this.postLogin()} className={Phonenumberisnotcodmm && Phonenumberisnotcodmm !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"} placeholder="密码"> {