From a8938e3a047826e547d35d0228140395bd168776 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, 23 Aug 2019 11:40:33 +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 --- .../src/modules/courses/elearning/Elearning.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/public/react/src/modules/courses/elearning/Elearning.js b/public/react/src/modules/courses/elearning/Elearning.js index ef6be4180..e4ae3fe94 100644 --- a/public/react/src/modules/courses/elearning/Elearning.js +++ b/public/react/src/modules/courses/elearning/Elearning.js @@ -60,11 +60,27 @@ class Elearning extends Component{ isSpin:false, }) }); + try { + if(this.props.current_user!==undefined){ + this.setState({ + userlogin :this.props.current_user.login, + }) + } + }catch (e) { + console.log("12312312312") + console.log(e); + } + } componentDidUpdate = (prevProps) => { + console.log("componentDidUpdate"); + console.log(prevProps); + console.log(this.props); if(prevProps.current_user!=this.props.current_user){ if(this.props.current_user!==undefined){ + // console.log(this.props.current_user.login); + // console.log(prevProps.current_user.login); this.setState({ userlogin :this.props.current_user.login, }) @@ -76,6 +92,8 @@ class Elearning extends Component{ //开始学习 Startlearning=()=>{ let {userlogin} = this.state; + console.log("userlogin"); + console.log(userlogin); if (userlogin === undefined) { this.setState({ isRender: true