链接进入题库详情等未认证需要跳转

dev_aliyun_beta
caicai8 6 years ago
parent 5bbfb9c00f
commit b9c0dc4201

@ -72,16 +72,32 @@ class BanksIndex extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.state={ this.state={
crumbData:undefined crumbData:undefined,
publicly:undefined
} }
} }
componentDidMount = () =>{
let pathname = this.props.location.pathname;
this.setState({
publicly:pathname.indexOf("/publicly") > -1
})
}
initPublic = (crumbData) =>{ initPublic = (crumbData) =>{
this.setState({ this.setState({
crumbData 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(){ render(){
let { crumbData }=this.state let { crumbData }=this.state
const common = { const common = {

Loading…
Cancel
Save