Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hss
cxt 5 years ago
commit ee0bf46e5a

@ -78,10 +78,10 @@ class BanksIndex extends Component{
} }
componentDidMount = () =>{ componentDidMount = () =>{
let pathname = this.props.location.pathname; // let pathname = this.props.location.pathname;
this.setState({ // this.setState({
publicly:pathname.indexOf("/publicly") > -1 // publicly:pathname.indexOf("/publicly") > -1
}) // })
} }
@ -92,16 +92,16 @@ class BanksIndex extends Component{
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if(prevProps.current_user!=this.props.current_user){ // if(prevProps.current_user!=this.props.current_user){
let { publicly }=this.state; // let { publicly }=this.state;
if( this.props.checkIfLogin()) { // if( this.props.checkIfLogin()) {
if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){ // if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){
this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`); // this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`);
} // }
} else { // } else {
this.props.showLoginDialog() // this.props.showLoginDialog()
} // }
} // }
// let { publicly }=this.state; // let { publicly }=this.state;
// if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){ // if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){
// if( this.props.checkIfLogin()) { // if( this.props.checkIfLogin()) {

Loading…
Cancel
Save