diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index db54c550f..1e79314d0 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -47,11 +47,11 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -debugType="admin"; +// debugType="admin"; // 老师 // debugType="teacher"; // 学生 -// debugType="student"; +debugType="student"; diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 4a1aaf08a..87ecb601c 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -750,46 +750,68 @@ class NewHeader extends Component { } // console.log(mygetHelmetapi2); - // console.log("NewHeadermygetHelmetapi123123123123"); - - let shixuntype = false; - let pathstype = false; - let coursestypes = false; - if (this.props && this.props.mygetHelmetapi != null) { - let shixun = "/shixuns"; - let paths = "/paths"; - let courses = "/courses"; - this.props.mygetHelmetapi.navbar.map((item, key) => { - var reg = RegExp(item.link); - if (shixun.match(reg)) { - if (item.hidden === true) { - shixuntype = true - } - } - if (paths.match(reg)) { - if (item.hidden === true) { - pathstype = true - } - } - if (courses.match(reg)) { - if (item.hidden === true) { - coursestypes = true - } - } - }) - } - - const contents = ( -
- ); - return ( + // console.log("NewHeadermygetHelmetapi123123123123"); + + let shixuntype=false; + let pathstype=false; + let coursestypes=false; + if(this.props&&this.props.mygetHelmetapi!=null){ + let shixun="/shixuns"; + let paths="/paths"; + let courses="/courses"; + this.props.mygetHelmetapi.navbar.map((item,key)=>{ + var reg = RegExp(item.link); + if(shixun.match(reg)){ + if(item.hidden===true){ + shixuntype=true + } + } + if(paths.match(reg)){ + if(item.hidden===true){ + pathstype=true + } + } + if(courses.match(reg)){ + if(item.hidden===true){ + coursestypes=true + } + } + }) + } + + const contents = ( + + ); + + // console.log("头部"); + // console.log(this.props); + //判断平台身份 + let Periofters=false; + if(this.props){ + if(this.props.current_user){ + if(this.props.current_user.admin){ + Periofters=true; + } + else if(this.props.current_user.business){ + Periofters=true; + } + else if(this.props.current_user.is_teacher){ + Periofters=true; + }else if(this.props.current_user.user_identity !=="学生") { + Periofters=true; + } + } + } + + + return (