From 51467cf3ef8ddb5bfc0ec3bb333affd8123bb8ef Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Fri, 21 Jun 2019 16:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/login/Trialapplication.js | 45 +++++++++---------- public/react/src/modules/tpm/NewHeader.js | 2 +- 2 files changed, 21 insertions(+), 26 deletions(-) diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index b86b68930..d98228856 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -44,18 +44,14 @@ class Trialapplication extends Component { componentWillReceiveProps(nextProps) { - // this.setState({ - // isRenders:nextProps.isRenders - // }) - // console.log("componentWillReceiveProps"); - // console.log(nextProps); + } //初始化数据 componentDidMount() { - // console.log("53"); + console.log("53"); - // console.log(this.props.isRenders); + console.log(this.props.isRenders); if (this.props.isRenders != undefined) { this.setState({ @@ -69,22 +65,6 @@ class Trialapplication extends Component { }) } - // 是否不显示手机栏 - let url = `/users/get_user_info.json` - axios.get(url,{params:{ - school:1 - } - }, - ).then((response) => { - if(response !==undefined){ - this.setState({ - user_phone_binded:response.data.user_phone_binded - }) - } - }).catch((error) => { - console.log(error) - }) - axios.interceptors.response.use((response) => { if (response != undefined) if (response && response.data.status === 407) { @@ -94,10 +74,22 @@ class Trialapplication extends Component { } return response; }, (error) => { - // // // TODO 这里如果样式变了会出现css不加载的情况 + //TODO 这里如果样式变了会出现css不加载的情况 + }); - // console.log("89"); + console.log("89"); + try { + if (this.state.props.user !== undefined) { + console.log(this.state.props.user && this.state.props.user.user_phone_binded); + this.setState({ + user_phone_binded: this.state.props.user.user_phone_binded, + }) + } + + } catch (e) { + console.log(e); + } } @@ -217,6 +209,7 @@ class Trialapplication extends Component { this.setState({ isRenders: false }) + this.Cancel(); window.location.href = "/"; } else { this.setState({ @@ -278,6 +271,8 @@ class Trialapplication extends Component { thiss.setState({ isRenders: false }) + thiss.Cancel(); + } else { thiss.setState({ isRenders: false diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 956e9afc4..3d3e83d36 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -583,7 +583,7 @@ submittojoinclass=(value)=>{ /> {/* :""*/} {/*}*/} - + {/*{*/} {/* isRenders&&isRenders===true?*/}