diff --git a/src/common/UrlTool.js b/src/common/UrlTool.js index 3944f49d..b99bfec4 100644 --- a/src/common/UrlTool.js +++ b/src/common/UrlTool.js @@ -1,6 +1,6 @@ import React from "react"; import md5 from 'md5'; -import {Input} from "antd"; +import { Input } from "antd"; const { Search } = Input; const $ = window.$; @@ -24,14 +24,14 @@ export function getImageUrl(path) { export function getImage(path) { // https://www.educoder.net // https://testbdweb.trustie.net - // const local = 'http://localhost:3000' + // const local = 'http://localhost:3000' const local = 'http://39.105.176.215:49999'; - if(path.indexOf("http://")===-1){ + if (path&&path.indexOf("http://") === -1) { if (isDev) { return `${local}/images/${path}` } return `/${path}`; - }else{ + } else { return path; } } @@ -39,14 +39,14 @@ export function getImage(path) { export function getTestImage(path) { // https://www.educoder.net // https://testbdweb.trustie.net - // const local = 'http://localhost:3000' + // const local = 'http://localhost:3000' const local = 'http://117.50.100.12:49999'; - if(path.indexOf("http://")===-1){ + if (path && path.indexOf("http://") === -1) { if (isDev) { return `${local}${path}` } return `${path}`; - }else{ + } else { return path; } } @@ -63,33 +63,33 @@ export function getLogoImageUrl(path) { export function getcdnImageUrl(path) { // https://www.educoder.net // https://testbdweb.trustie.net - // const local = 'http://localhost:3000' - const testlocal = 'https://testali-cdn.educoder.net' - const local='https://ali-cdn.educoder.net' - let firstStr=path.substr(0,1); + // const local = 'http://localhost:3000' + const testlocal = 'https://testali-cdn.educoder.net' + const local = 'https://ali-cdn.educoder.net' + let firstStr = path.substr(0, 1); if (isdev2) { return `${local}/${path}`; - }else{ - if(firstStr=="/"){ + } else { + if (firstStr == "/") { return `${path}` - }else{ + } else { return `/${path}` } } // return `${local}/${path}`; } -export function setcndImagesUrl(path){ +export function setcndImagesUrl(path) { const testlocal = 'https://testali-cdn.educoder.net' - const local='https://ali-cdn.educoder.net' - let firstStr=path.substr(0,1); - if(firstStr=="/"){ + const local = 'https://ali-cdn.educoder.net' + let firstStr = path.substr(0, 1); + if (firstStr == "/") { if (!isdev2) { return `${path}` } return `${local}${path}`; - //return isDev?`${testlocal}${path}`:`${local}${path}`; - }else{ + //return isDev?`${testlocal}${path}`:`${local}${path}`; + } else { if (!isdev2) { return `/${path}` } @@ -100,31 +100,31 @@ export function setcndImagesUrl(path){ -export function setImagesUrl(path){ +export function setImagesUrl(path) { const testlocal = 'https://testali-cdn.educoder.net' - const local='https://ali-cdn.educoder.net' - let firstStr=path.substr(0,1); - if(firstStr=="/"){ + const local = 'https://ali-cdn.educoder.net' + let firstStr = path.substr(0, 1); + if (firstStr == "/") { if (!isdev2) { return `${path}` } return `${local}${path}`; // return isDev?`${testlocal}${path}`:`${path}`; - }else{ + } else { if (!isdev2) { return `/${path}` } return `${local}/${path}`; - //return isDev?`${testlocal}/${path}`:`/${path}`; + //return isDev?`${testlocal}/${path}`:`/${path}`; } } export function getUrl(path, goTest) { const local = 'http://39.105.176.215:49999' if (isDev) { - return `${local}${path?path:''}` + return `${local}${path ? path : ''}` } - return `${path ? path: ''}`; + return `${path ? path : ''}`; } export function getUrlmys(path, goTest) { @@ -138,9 +138,9 @@ export function getUrlmys(path, goTest) { // const local = 'https://testeduplus2.educoder.net' const local = 'https://test-jupyterweb.educoder.net' if (isDev) { - return `${local}${path?path:''}` + return `${local}${path ? path : ''}` } - return `${path ? path: ''}`; + return `${path ? path : ''}`; } export function getStaticUrl() { const local = TEST_HOST; @@ -151,27 +151,29 @@ export function getStaticUrl() { return '' } export function getUrl2(path, goTest) { - const local = 'http://localhost:3000' + const local = 'http://localhost:3000' if (isDev) { - return `${local}${path?path:''}` + return `${local}${path ? path : ''}` } - return `${path ? path: ''}`; + return `${path ? path : ''}`; } -const newopens ="79e33abd4b6588941ab7622aed1e67e8"; +const newopens = "79e33abd4b6588941ab7622aed1e67e8"; let newtimestamp; let checkSubmitFlgs = false; function railsgettimess(proxy) { - if(checkSubmitFlgs===false){ - $.ajax({url:proxy, - async:false,success:function(data){ - if(data.status===0){ - newtimestamp=data.message; + if (checkSubmitFlgs === false) { + $.ajax({ + url: proxy, + async: false, success: function (data) { + if (data.status === 0) { + newtimestamp = data.message; checkSubmitFlgs = true; } - }}) + } + }) window.setTimeout(function () { - checkSubmitFlgs=false; + checkSubmitFlgs = false; }, 2500); } } @@ -214,8 +216,8 @@ export function getUploadActionUrlOfAuth(id) { } export function getRandomNumber(type) { - let anewopens=md5(newopens+newtimestamp); - return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}` + let anewopens = md5(newopens + newtimestamp); + return type === true ? `randomcode=${newtimestamp}&client_key=${anewopens}` : `?randomcode=${newtimestamp}&client_key=${anewopens}` } export function test(path) { @@ -249,20 +251,20 @@ export function htmlEncode(str) { return s; } -export function publicSearchs(Placeholder,onSearch,onInputs,onChanges,loadings) { - return() } export function getUrlToken(name, str) { - const reg = new RegExp(`(^|&)${ name}=([^&]*)(&|$)`); - const r = str.substr(1).match(reg); - if (r != null) return decodeURIComponent(r[2]); return null; + const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`); + const r = str.substr(1).match(reg); + if (r != null) return decodeURIComponent(r[2]); return null; } \ No newline at end of file diff --git a/src/forge/Component/Handbook.jsx b/src/forge/Component/Handbook.jsx index d26c0a8f..0c8f5100 100644 --- a/src/forge/Component/Handbook.jsx +++ b/src/forge/Component/Handbook.jsx @@ -5,7 +5,7 @@ import './Component.scss'; export default (()=>{ return(
- +
diff --git a/src/home/FifthSection/index.jsx b/src/home/FifthSection/index.jsx index 64eed1a0..18f81b39 100644 --- a/src/home/FifthSection/index.jsx +++ b/src/home/FifthSection/index.jsx @@ -155,7 +155,7 @@ function FifthSection({ fifth, history }) {

创客空间

-

开源项目版块集项目托管、版本管理等功能于一体,为开源协作和群智汇聚提供创作环境

+

创客空间版块面向大众智慧群体征集技术成果、创意概念和解决方案,实现供需高效对接

社区动态

-

为社区用户提供自主交流空间,实现思维碰撞和智慧融合

+

关注开源热点资讯与技术,分享红山观点与活动

@@ -77,7 +77,7 @@ function SecondSection({ second ,main_web_site_url}) {
- +
diff --git a/src/home/SeventhSection/index.jsx b/src/home/SeventhSection/index.jsx index f7dc3d49..97a8f560 100644 --- a/src/home/SeventhSection/index.jsx +++ b/src/home/SeventhSection/index.jsx @@ -27,7 +27,7 @@ let setting = { } -function SeventhSection({ main_web_site_url }) { +function SeventhSection({ main_web_site_url,btnUrl }) { const [list, setList] = useState([]); @@ -79,7 +79,7 @@ function SeventhSection({ main_web_site_url }) { - + diff --git a/src/home/SeventhSection/index.scss b/src/home/SeventhSection/index.scss index e13901bb..a9889f88 100644 --- a/src/home/SeventhSection/index.scss +++ b/src/home/SeventhSection/index.scss @@ -159,21 +159,21 @@ .issue-content { text-align: left; text-indent: 2em; - font-size: 15px; + font-size: 0.95em; font-weight: 400; color: #3c476e; - line-height: 28px; + line-height: 1.75em; } .issue-time { - height: 28px; - font-size: 15px; + height: 1.75em; + font-size: 0.95em; color: #3c476e; - line-height: 28px; + line-height: 1.75em; } } .homepage-btn { - margin-top: 50px; + margin-top: 3.125em; } @keyframes zoomin { diff --git a/src/home/SixthSection/index.jsx b/src/home/SixthSection/index.jsx index 838fa01e..59a3800c 100644 --- a/src/home/SixthSection/index.jsx +++ b/src/home/SixthSection/index.jsx @@ -17,7 +17,7 @@ import './index.scss'; let iconArr = [completeIcon1, completeIcon2, completeIcon3]; -function SixthSection({ sixth, main_web_site_url }) { +function SixthSection({ sixth, main_web_site_url,btnUrl }) { const [list, setList] = useState(); @@ -78,7 +78,7 @@ function SixthSection({ sixth, main_web_site_url }) { - + diff --git a/src/home/index.jsx b/src/home/index.jsx index 96b5c425..46b5db6e 100644 --- a/src/home/index.jsx +++ b/src/home/index.jsx @@ -33,6 +33,18 @@ function HomePage({ history }) { let settings = JSON.parse(localStorage.chromesetting); let main_web_site_url = settings.main_web_site_url; + let forumUrl =""; + let competitionUrl =""; + if(settings.navbar){ + for (const item of settings.navbar){ + if(item.name.indexOf("论坛")>-1){ + forumUrl=item.link; + } + if(item.name.indexOf("竞赛")>-1){ + competitionUrl=item.link; + } + } + } function scrollListener() { @@ -120,7 +132,7 @@ function HomePage({ history }) {
- +
@@ -137,11 +149,11 @@ function HomePage({ history }) {
- +
- +