From 38e307487a29dd9f904356d0c1a920a39bdc0aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 20 Aug 2019 10:46:05 +0800 Subject: [PATCH] Merge branches 'dev_Ysm' and 'dev_admin' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl # Conflicts: # app/controllers/application_controller.rb --- .../modules/courses/elearning/Elearning.js | 26 +++++++++--------- .../courses/elearning/YslDetailCards.js | 27 +++++++++++++++---- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js index d587d88c8..81f300538 100644 --- a/public/react/src/modules/courses/elearning/Elearning.js +++ b/public/react/src/modules/courses/elearning/Elearning.js @@ -75,7 +75,19 @@ class Elearning extends Component{ }; //开始学习 Startlearning=()=>{ - this.Tojoinclass(); + let {userlogin} = this.state; + if (userlogin === undefined) { + this.setState({ + isRender: true + }) + return + } + if (userlogin === "") { + this.setState({ + isRender: true + }) + return; + } if(this.props.isNotMember()===true){ this.setState({ yslJointhe:true @@ -221,20 +233,10 @@ class Elearning extends Component{ }) }; Tojoinclass=()=> { - let {userlogin} = this.state; - if (userlogin === undefined) { - this.setState({ - isRender: true - }) - return - } - if (userlogin === "") { this.setState({ isRender: true }) - return; - } - } + }; render(){ let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages,isRender} =this.state; diff --git a/public/react/src/modules/courses/elearning/YslDetailCards.js b/public/react/src/modules/courses/elearning/YslDetailCards.js index 38cc32d18..a1ad44e67 100644 --- a/public/react/src/modules/courses/elearning/YslDetailCards.js +++ b/public/react/src/modules/courses/elearning/YslDetailCards.js @@ -34,13 +34,30 @@ class YslDetailCards extends Component{ }; startgameid=(id)=>{ // 上面传过来的方法是用来没登入弹出弹框的 - this.props.Tojoinclass(); + try { + let {userlogin} = this.props; + if (userlogin === undefined) { + this.props.Tojoinclass(); + return + } + if (userlogin === "") { + this.props.Tojoinclass(); + return; + } + }catch (e) { - if(this.props.isNotMember()===true){ - //这个是外部传过来的 - this.props.Startlearningtwo(); - return } + + try { + if(this.props.isNotMember()===true){ + //这个是外部传过来的 + this.props.Startlearningtwo(); + return + } + }catch (e) { + + } + let url = "/shixuns/" + id + "/shixun_exec.json"; axios.get(url).then((response) => {