From 1636eaa87284bff86179fd26bb72702d78f3fcb1 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:17:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4login=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 2 +- public/react/src/modules/tpm/TPMIndex.css | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index f335f1705..4acbb35a7 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -32,7 +32,7 @@ module.exports = { // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // devtool: "cheap-module-eval-source-map", // 开启调试 - devtool: "source-map", // 开启调试 + //devtool: "source-map", // 开启调试 // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. diff --git a/public/react/src/modules/tpm/TPMIndex.css b/public/react/src/modules/tpm/TPMIndex.css index 076777945..740ae8a20 100644 --- a/public/react/src/modules/tpm/TPMIndex.css +++ b/public/react/src/modules/tpm/TPMIndex.css @@ -216,5 +216,6 @@ body>.-task-title { .logoimg{ float: left; - width: 40px; + min-width: 40px; + height:40px; } \ No newline at end of file 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 2/2] =?UTF-8?q?=E4=BA=91=E4=B8=8A=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E5=AE=A4=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 (
@@ -1244,12 +1244,12 @@ submittojoinclass=(value)=>{ {/*href="https://www.educoder.net/login"*/}
{/*{ loadHeader()}*/} - {showSearchOpentype===true?"":this.showSearchOpen(e)}> + {showSearchOpentype===true?"":this.props.user&&this.props.user.main_site===true?this.showSearchOpen(e)}> {/*"/images/educoder/icon/search.svg" */} - } + :""} {/*
*/}
diff --git a/public/react/src/modules/tpm/component/TPMRightSection.js b/public/react/src/modules/tpm/component/TPMRightSection.js index 5fb9fadc4..803e1caf2 100644 --- a/public/react/src/modules/tpm/component/TPMRightSection.js +++ b/public/react/src/modules/tpm/component/TPMRightSection.js @@ -118,7 +118,7 @@ class TPMRightSection extends Component { } -

所属课程

@@ -159,10 +159,10 @@ class TPMRightSection extends Component { }) }
-
+
:""} {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`}>题库 -
  • } + :""}