From c00f7316b176257e078e5401bd264ce1410bf8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 19 Feb 2020 15:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 4 +- public/react/src/modules/tpm/NewHeader.js | 129 +++++++++++++--------- 2 files changed, 80 insertions(+), 53 deletions(-) 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 (
- {/*
  • */} - {/* */} - {/*
    */} - {/*
    */} - {/* 题库*/} - {/*
    */} - {/*
    */} - {/*
    */} - {/*
  • */} + { + Periofters===true? +
  • + +
    +
    + 题库 +
    +
    +
    +
  • + :"" + } +