From cee99f3d57876b679246bdffe1c28ce4330c40b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Wed, 13 Nov 2019 15:59:18 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=91=E4=B8=8A=E5=AE=9E=E9=AA=8C=E5=AE=A4?=
=?UTF-8?q?=E7=9B=B8=E5=85=B3=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/home/shixunsHome.js | 46 ++++++++++++-------
public/react/src/modules/tpm/NewHeader.js | 6 +--
.../modules/tpm/component/TPMRightSection.js | 10 ++--
.../src/modules/user/usersInfo/InfosBanner.js | 10 ++--
4 files changed, 43 insertions(+), 29 deletions(-)
diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js
index 67fbab26b..ab51853ed 100644
--- a/public/react/src/modules/home/shixunsHome.js
+++ b/public/react/src/modules/home/shixunsHome.js
@@ -112,13 +112,27 @@ class ShixunsHome extends Component {
}
const MyRate = ({ defaultValue, ...rest }) => {
let myValue = defaultValue;
- // console.log(myValue-Math.floor(myValue))
- // if (myValue < Math.ceil(myValue)) {
- // myValue = Math.floor(myValue) + 0.5;
- // }
-
return ;
};
+
+ let shixuntype=false;
+ let pathstype=false;
+ if(this.props&&this.props.mygetHelmetapi!=null){
+ console.log(this.props.mygetHelmetapi.navbar)
+ let shixun="/shixuns";
+ let paths="/paths";
+ this.props.mygetHelmetapi.navbar.map((item,key)=>{
+ var reg = RegExp(item.link);
+ if(shixun.match(reg)){
+ shixuntype=true
+ }
+ if(paths.match(reg)){
+ pathstype=true
+ }
+ })
+
+
+ }
return (
{this.state.updata===undefined?"":
}
-
+ {this.props.user&&this.props.user.main_site===true?
{homedatalist === undefined ? "" :homedatalistreps.map((item,key)=>{
@@ -212,13 +226,13 @@ class ShixunsHome extends Component {
}
-
+
:""}
{/*实训路径*/}
-
+ {pathstype===true?
实践课程
TRAINING COURSE
@@ -294,10 +308,10 @@ class ShixunsHome extends Component {
}
-
+
:""}
{/*精选实训 改为 开发社区*/}
-
+ {shixuntype===true?
实训项目
DEVELOPMENT COMMUNITY
@@ -389,13 +403,13 @@ class ShixunsHome extends Component {
-
+
:""}
- {/*导师排行榜*/}
+ {/*导师排行榜*/}
{ homedatalist !== undefined && homedatalist.teachers !== undefined && (
-
+ this.props.user&&this.props.user.main_site===true?
导师排行榜
@@ -470,12 +484,12 @@ class ShixunsHome extends Component {
-
+
:""
)}
{/*程序员排行榜*/}
{ homedatalist !== undefined && homedatalist.students !== undefined && (
-
+ this.props.user&&this.props.user.main_site===true?
程序员排行榜
@@ -546,7 +560,7 @@ class ShixunsHome extends Component {
-
+
:""
)}
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js
index 8a313a904..4de133b39 100644
--- a/public/react/src/modules/tpm/NewHeader.js
+++ b/public/react/src/modules/tpm/NewHeader.js
@@ -876,7 +876,7 @@ submittojoinclass=(value)=>{
// console.log(mygetHelmetapi2);
// console.log("NewHeadermygetHelmetapi123123123123");
// console.log(mygetHelmetapi2);
- // console.log(this.props);
+
return (
:""}
{TPMRightSectionData === undefined?"":TPMRightSectionData.paths===undefined?"":TPMRightSectionData.paths.length === 0 ? "" :
-
-
}
-
+ :""
+ }
}
diff --git a/public/react/src/modules/user/usersInfo/InfosBanner.js b/public/react/src/modules/user/usersInfo/InfosBanner.js
index 40732d757..82a52ba95 100644
--- a/public/react/src/modules/user/usersInfo/InfosBanner.js
+++ b/public/react/src/modules/user/usersInfo/InfosBanner.js
@@ -34,7 +34,7 @@ class InfosBanner extends Component{
// console.log(is_current)
// console.log(current_user)
// console.log(current_user.is_teacher)
- // console.log(current_user.admin)
+
return(
@@ -116,20 +116,20 @@ class InfosBanner extends Component{
{/* onClick={() => this.setState({moduleName: 'package'})}*/}
{/* to={`/users/${username}/package`}>众包*/}
{/**/}
- {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
+ {this.props.user&&this.props.user.main_site===true?((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&&
this.setState({moduleName: 'videos'})}
to={`/users/${username}/videos`}>视频
- }
+ :""}
{/*自己的主页且不是学生显示题库按钮*/}
- {(is_current && current_user&& current_user.is_teacher )
+ {this.props.user&&this.props.user.main_site===true?(is_current && current_user&& current_user.is_teacher )
&&
this.setState({moduleName: 'topics'})}
to={`/users/${username}/topics/personal`}>题库
- }
+ :""}