diff --git a/src/App.js b/src/App.js index 67ec0ab4d..7c9d0a96a 100644 --- a/src/App.js +++ b/src/App.js @@ -290,7 +290,7 @@ class App extends Component { ( - + // ) } diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index f952f22c6..3648323dc 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -34,6 +34,15 @@ export function getImage(path) { } } +export function getLogoImageUrl(path) { + const local = 'http://117.50.100.12:49999'; + + if (isDev) { + return `${local}/${path}` + } + return `/${path}`; +} + export function getcdnImageUrl(path) { // https://www.educoder.net // https://testbdweb.trustie.net diff --git a/src/common/educoder.js b/src/common/educoder.js index c6eaf176d..a67a6d441 100644 --- a/src/common/educoder.js +++ b/src/common/educoder.js @@ -6,7 +6,7 @@ export { getUploadLogoActionUrl as getUploadLogoActionUrl, getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl , getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth - , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl + , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl,getLogoImageUrl as getLogoImageUrl } from './UrlTool'; export { setmiyah as setmiyah } from './Component'; diff --git a/src/home/index.jsx b/src/home/index.jsx index e3481436b..b72d28232 100644 --- a/src/home/index.jsx +++ b/src/home/index.jsx @@ -1,11 +1,16 @@ import React, { useEffect, useState } from 'react'; import NewSlide from "./NewSlide"; +import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC'; + import './index.scss'; -function HomePage() { +function HomePage(props) { return ( -
+
+
+
+
@@ -14,8 +19,8 @@ function HomePage() { - - + {/* */} + @@ -27,5 +32,4 @@ function HomePage() { ) } - -export default HomePage; \ No newline at end of file +export default TPMIndexHOC(HomePage); diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 9d1d53202..eefad5eec 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import { Link } from "react-router-dom"; import AccountProfile from "../user/AccountProfile"; -import { getImageUrl } from 'educoder' +import { getImageUrl,getLogoImageUrl } from 'educoder' import axios from 'axios'; import { Modal, Input, message, notification } from 'antd'; @@ -586,6 +586,8 @@ class NewHeader extends Component { return true } else if (url.indexOf('users') > -1 && match.path.indexOf('users') > -1) { return true + } else if (['http://117.50.100.12:8080','https://osredm.com'].includes(url) && match.path === '/') { + return true } else { return false } @@ -618,74 +620,79 @@ class NewHeader extends Component { mygetHelmetapi2, goshowqqgtounp, } = this.state; - /*用户名称 用户头像url*/ - let activeIndex = false; - let activeForums = false; - let activeShixuns = false; - let activePaths = false; - let coursestype = false; - let activePackages = false; - let activeMoopCases = false; - let activeCompetitions = false; - if (match.path === '/forums') { - activeForums = true; - } else if (match.path.startsWith('/shixuns')) { - activeShixuns = true; - } else if (match.path.startsWith('/paths')) { - activePaths = true; - } else if (match.path.startsWith('/courses')) { - coursestype = true; - } else if (match.path.startsWith('/crowdsourcing')) { - activePackages = true; - } else if (match.path.startsWith('/moop_cases')) { - activeMoopCases = true; - } else if (match.path.startsWith('/competitions')) { - activeCompetitions = true; - } else { + let activeIndex = ''; + if(match.path === '/'){ activeIndex = true; } - let headtypes = '/'; - if (mygetHelmetapi2) { - if (mygetHelmetapi2.navbar) { - if (mygetHelmetapi2.navbar.length > 0) { - if (match.path === '/') { - if (headtypesonClickbool === false) { - headtypes = undefined; - } else { - headtypes = headtypess; - } - } else { - for (var i = 0; i < mygetHelmetapi2.navbar.length; i++) { - if (match.path === mygetHelmetapi2.navbar[i].link) { - headtypes = mygetHelmetapi2.navbar[i].link; - break; - } - } - } - } - } - } - let shixuntype = false; - let pathstype = false; + /*用户名称 用户头像url*/ + // let activeIndex = false; + // let activeForums = false; + // let activeShixuns = false; + // let activePaths = false; + // let coursestype = false; + // let activePackages = false; + // let activeMoopCases = false; + // let activeCompetitions = false; + + // if (match.path === '/forums') { + // activeForums = true; + // } else if (match.path.startsWith('/shixuns')) { + // activeShixuns = true; + // } else if (match.path.startsWith('/paths')) { + // activePaths = true; + // } else if (match.path.startsWith('/courses')) { + // coursestype = true; + // } else if (match.path.startsWith('/crowdsourcing')) { + // activePackages = true; + // } else if (match.path.startsWith('/moop_cases')) { + // activeMoopCases = true; + // } else if (match.path.startsWith('/competitions')) { + // activeCompetitions = true; + // } else { + // activeIndex = true; + // } + // let headtypes = '/'; + // if (mygetHelmetapi2) { + // if (mygetHelmetapi2.navbar) { + // if (mygetHelmetapi2.navbar.length > 0) { + // if (match.path === '/') { + // if (headtypesonClickbool === false) { + // headtypes = undefined; + // } else { + // headtypes = headtypess; + // } + // } else { + // for (var i = 0; i < mygetHelmetapi2.navbar.length; i++) { + // if (match.path === mygetHelmetapi2.navbar[i].link) { + // headtypes = mygetHelmetapi2.navbar[i].link; + // break; + // } + // } + // } + // } + // } + // } + // let shixuntype = false; + // let pathstype = false; let coursestypes = false; if (this.props && this.props.mygetHelmetapi != null) { - let shixun = "/shixuns"; - let paths = "/paths"; + // 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 (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 @@ -694,7 +701,7 @@ class NewHeader extends Component { }) } return ( -
+
{isRender === true ? { mygetHelmetapi2 && mygetHelmetapi2.nav_logo_url ? - 可控开源社区 + 可控开源社区 : "" } @@ -762,7 +769,7 @@ class NewHeader extends Component {
{this.props.user && this.props.user.login &&
- +
{ @@ -816,18 +823,18 @@ class NewHeader extends Component {
{user === undefined ? - this.educoderlogin()} className="mr5 color-grey-6">登录 + this.educoderlogin()} className={`mr5 ${activeIndex ? 'color-white' : 'color-grey-6'}`}>登录 { mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.register_url && - 注册 + 注册 } : user.login === "" ? - this.educoderlogin()} className="mr5 color-grey-6">登录 + this.educoderlogin()} className={`mr5 ${activeIndex ? 'color-white' : 'color-grey-6'}`}>登录 { mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.register_url && - 注册 + 注册 } : diff --git a/src/modules/tpm/css/headerExcess.css b/src/modules/tpm/css/headerExcess.css index 08ee83771..d0104c368 100644 --- a/src/modules/tpm/css/headerExcess.css +++ b/src/modules/tpm/css/headerExcess.css @@ -9,4 +9,12 @@ left:0px; bottom: 12px; position: absolute; -} \ No newline at end of file +} + +.newHeaders.homePage{ + background-color: #1A2358; +} +.newHeaders.homePage .head-nav ul#header-nav li a{ + color: #fff; +} +