From 9aab1bd63d9817a556d0532c7c778b4686f2bede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 26 Jul 2019 17:54:58 +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 | 30 +++++++++++++++---- .../modules/user/LoginRegisterComponent.js | 4 +-- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index d3df6090e..a4dee4b4c 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -13,6 +13,7 @@ import axios from 'axios'; import './LoginDialog.css'; import { broadcastChannelPostMessage } from 'educoder' +import Notcompletedysl from "../user/Notcompletedysl"; const $ = window.$; var wait = 60; @@ -100,6 +101,7 @@ class LoginDialog extends Component { authCodeType:true, authCodeclass:'log-botton mt5', isRender: false, + MyEduCoderModals:false, }; } @@ -365,11 +367,12 @@ class LoginDialog extends Component { description:response.data.message, }); }else{ - if(response.data.identity === null || response.data.identity === undefined){ - this.props.history.push("/interesse"); + if(response.data.profile_completed !== null || response.data.profile_completed === false){ + this.setMyEduCoderModals(); return; } - broadcastChannelPostMessage('refreshPage') + + broadcastChannelPostMessage('refreshPage') this.setState({ isRender:false }) @@ -388,17 +391,28 @@ class LoginDialog extends Component { console.log(error) }) - } + }; + setNotcompleteds=()=>{ + this.setState({ + Notcompleteds:true, + MyEduCoderModals:false + }) + }; + setMyEduCoderModals=()=>{ + this.setState({ + MyEduCoderModals:true + }) + }; onKeydowns=(e)=>{ let {disabled}=this.state; if( disabled===false&& e.keyCode === 13){ this.loginEDU() console.log(1) } - } + }; getloginurl=(url)=>{ window.location.href = url; - } + }; render() { let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; @@ -414,6 +428,10 @@ class LoginDialog extends Component { disableBackdropClick={true} onClose={() => this.handleDialogClose()} > + {this.setNotcompleteds()}} + /> {isRender===true?
{this.handleDialogClose()}}> diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 081f868a7..9b1533bea 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -340,8 +340,8 @@ class LoginRegisterComponent extends Component { } - if(response.data.identity === null || response.data.identity === undefined){ - this.props.history.push("/interesse"); + if(response.data.profile_completed !== null || response.data.profile_completed === false){ + this.setMyEduCoderModals(); return; }