diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index 39eeaf115..9c1923452 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -69,16 +69,20 @@ class ListPageIndex extends Component{ super(props); this.state={ yslGuideone:undefined, + mysearch:undefined, } } componentDidMount(){ - var yslGuideone = window.localStorage.getItem('yslGuideone'); + var yslGuideone = window.sessionStorage.getItem('yslGuideone'); console.log("77"); console.log(yslGuideone); + var mysearchs= this.props.location.search===""?undefined:this.props.location.search===undefined?undefined:this.props.location.search==="?exhibition=true"?true:undefined; this.setState({ yslGuideone:yslGuideone, + mysearch:mysearchs, }) + } // // getleftNavid=(navid,newselectnavid)=>{ @@ -89,37 +93,42 @@ class ListPageIndex extends Component{ // }) // } componentWillUnmount(){ - window.localStorage.setItem('yslGuideone', false); - + window.sessionStorage.setItem('yslGuideone', false); } setwindowlocal=(bool)=>{ - window.localStorage.setItem('yslGuideone', bool); + window.sessionStorage.setItem('yslGuideone', bool); this.setState({ yslGuideone:bool, - }) + mysearch:undefined, + }); + var currenturl = this.props.location.pathname; + var newUrl = (currenturl.split("?"))[0]; + window.history.pushState('','',newUrl); } render() { - let {yslGuideone} =this.state; - console.log("98"); - console.log(yslGuideone); - console.log(this.props.isAdmin()); - var yslGuideones = window.localStorage.getItem('yslGuideone'); + let {yslGuideone,mysearch} =this.state; + // console.log("98"); + // console.log(yslGuideone); + // console.log(this.props.isAdmin()); + // // var yslGuideones = window.sessionStorage.getItem('yslGuideone'); + // console.log(this.props); + // console.log(this.props.location.search); return (