From b9c0dc42011d7f075aef2608af2c66c048e66c05 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Fri, 6 Sep 2019 15:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=BE=E6=8E=A5=E8=BF=9B=E5=85=A5=E9=A2=98?= =?UTF-8?q?=E5=BA=93=E8=AF=A6=E6=83=85=E7=AD=89=E6=9C=AA=E8=AE=A4=E8=AF=81?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/user/usersInfo/banks/BanksIndex.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js index 2a3c5c98d..ceaccc5f5 100644 --- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js +++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js @@ -72,16 +72,32 @@ class BanksIndex extends Component{ constructor(props){ super(props); this.state={ - crumbData:undefined + crumbData:undefined, + publicly:undefined } } + componentDidMount = () =>{ + let pathname = this.props.location.pathname; + this.setState({ + publicly:pathname.indexOf("/publicly") > -1 + }) + } + initPublic = (crumbData) =>{ this.setState({ crumbData }) } + componentDidUpdate=()=>{ + let { publicly }=this.state + + if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){ + this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`); + } + } + render(){ let { crumbData }=this.state const common = {