From e35c8e4cdfc7277f834cecbe0dbf35090a253640 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Mon, 23 Mar 2020 20:33:47 +0800 Subject: [PATCH] issue --- public/index.html | 115 +-------------------- src/forge/Index.js | 7 +- src/forge/Main/Index.js | 2 + src/modules/tpm/NewHeader.js | 9 +- src/modules/tpm/TPMIndexHOC.js | 183 +++++++++++++-------------------- 5 files changed, 75 insertions(+), 241 deletions(-) diff --git a/public/index.html b/public/index.html index fe19a8c24..01c01f881 100755 --- a/public/index.html +++ b/public/index.html @@ -3,11 +3,8 @@ - - - @@ -18,28 +15,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -112,64 +61,12 @@
- - - - - - - - - - - - - - - - - - - - - +
- - - - - - - + - - - - - - diff --git a/src/forge/Index.js b/src/forge/Index.js index 42d83baf5..e76fd4d9f 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -35,17 +35,12 @@ const ProjectDetail = Loadable({ class Index extends Component{ constructor(props){ super(props); - this.state={ - current_user:undefined, - } - } - componentDidMount=()=>{ - document.title="forge开源"; } render(){ + console.log("123",this.props); return(
diff --git a/src/forge/Main/Index.js b/src/forge/Main/Index.js index fe5d065da..2c13704a1 100644 --- a/src/forge/Main/Index.js +++ b/src/forge/Main/Index.js @@ -218,11 +218,13 @@ class Index extends Component{
+ 新建 + 排序 diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js index 53daa7e3a..81c12edba 100644 --- a/src/modules/tpm/NewHeader.js +++ b/src/modules/tpm/NewHeader.js @@ -76,21 +76,14 @@ class NewHeader extends Component { goshowqqgtounp:false, visiblemyss:false, } - // console.log("176") - // console.log(props); - // console.log("NewHeader1234567890"); - // console.log(this.props); } componentDidUpdate = (prevProps) => { - // console.log("componentDidMount2"); - // console.log(this.state.mygetHelmetapi2); if(this.state.mygetHelmetapi2===undefined){ this.getAppdata(); } } componentDidMount() { - // console.log("componentDidMount1"); - this.getAppdata(); + this.getAppdata(); window._header_componentHandler = this; //下拉框的显示隐藏 diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index 00123045b..fb57bf65b 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -20,20 +20,13 @@ import Trialapplication from "../login/Trialapplication"; const $ = window.$; const versionNum = '0001'; -// let _url_origin = getUrl() let _url_origin=''; if(window.location.port === "3007"){ _url_origin="https://test-newweb.educoder.net"; } - -// let _url_origin=`https://www.educoder.net`; - if (!window['indexHOCLoaded']) { window.indexHOCLoaded = true; //解决首屏加载问题 - - // $('head').append($('') - // .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`)); $('head').append($('') .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?3`)); @@ -44,20 +37,6 @@ if (!window['indexHOCLoaded']) { $('head').append($('') .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?3`)); - - // $('head').append($('') - // .attr('href', `${_url_origin}/stylesheets/educoder/css_min_all.css?1525440977`)); - // 加timeout 为了覆盖掉antd的样式 - // setTimeout(() => { - // $('head').append( $('') - // .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?1525440977`) ); - - // $('head').append( $('') - // .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1525440977`) ); - // $('head').append( $('') - // .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?1525440977`) ); - // }, 1000); - $("script").append('') .attr('src', `${_url_origin}/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js?_t=${versionNum}`); @@ -163,41 +142,17 @@ export function TPMIndexHOC(WrappedComponent) { }else if(this.props.match.path==="/paths"){ document.title="实践课程"; }else if(this.props.match.path==="/courses"){ - document.title="翻转课堂"; + document.title="翻转课堂"; + }else if(this.props.match.path==="/projects"){ + document.title="开源项目"; } - // if(this.props.match.path==="/"){ - // document.title="EduCoder-IT实践教学平台_信息技术类精品课程网_大学生MOOC平台"; - // }else if(this.props.match.path==="/403"){ - // document.title="你没有权限访问"; - // }else if(this.props.match.path==="/nopage"){ - // document.title="没有找到该页面"; - // }else if(this.props.match.path==="/shixuns"){ - // document.title="EduCoder-IT实践教学平台_信息技术类精品课程网_大学生MOOC平台"; - // }else if(this.props.match.path==="/paths"){ - // document.title="实践课程_项目实战开发_web前端开发实训_web后端开发实战_人工智能技术-EduCoder"; - // }else if(this.props.match.path==="/courses"){ - // document.title="实训项目_php后端开发_app前端开发_java_python实训_C语言入门课程-EduCoder"; - // }else if(this.props.match.path==="/competitions"){ - // document.title="在线竞赛_计算机应用大赛_编程大赛_大学生设计大赛_全国高校绿色计算大赛-EduCoder"; - // }else if(this.props.match.path==="/moop_cases"){ - // document.title="教学案例-EduCoder"; - // }else if(this.props.match.path==="/forums"){ - // document.title="交流问答-EduCoder"; - // }else if(this.props.match.path==="/forums"){ - // document.title="交流问答-EduCoder"; - // } - $.ajaxSetup({ cache: true }); //帮助后台传参数 const query = this.props.location.search; - // const type = query.split('?chinaoocTimestamp='); - // console.log("Eduinforms12345"); - // console.log(this.foo(query)); - // console.log(JSON.stringify(this.foo(query))); var dataqueryss={} try { var foqus=this.foo(query); @@ -218,23 +173,23 @@ export function TPMIndexHOC(WrappedComponent) { } this.fetchUsers(dataqueryss); - let url=`/users/get_navigation_info.json`; - axios.get(url, { + // let url=`/users/get_navigation_info.json`; + // axios.get(url, { - }).then((response) => { - // console.log("开始请求/get_navigation_info.json"); - // console.log(response); - if(response!=undefined){ - if(response.status===200){ - this.setState({ - Headertop:response.data.top, - Footerdown:response.data.down - }) - } - } - }); + // }).then((response) => { + // // console.log("开始请求/get_navigation_info.json"); + // // console.log(response); + // if(response!=undefined){ + // if(response.status===200){ + // this.setState({ + // Headertop:response.data.top, + // Footerdown:response.data.down + // }) + // } + // } + // }); ///请求定制化的信息 - this.getAppdata(); + // this.getAppdata(); } /** 课堂权限相关方法,暂时写这里了 ----------------------------------------START @@ -335,67 +290,67 @@ export function TPMIndexHOC(WrappedComponent) { document.head.appendChild(link); } //获取当前定制信息 - getAppdata = () => { - try { - var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting')); - var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse')); - // console.log("TPMLNdexHOC"); - // console.log(chromesettingArray); - // console.log(chromesettingresponseArray); - this.setState({ - mygetHelmetapi:chromesettingArray - }); - if (chromesettingArray.tab_logo_url) { - this.gettablogourldata(chromesettingresponseArray); - } else { - this.gettablogourlnull(); - } - }catch (e) { - console.log("hoc获取游览器配置失败 重新请求开始读取配置"); - this.getAppdatausr(); - } + // getAppdata = () => { + // try { + // var chromesettingArray = JSON.parse(localStorage.getItem('chromesetting')); + // var chromesettingresponseArray = JSON.parse(localStorage.getItem('chromesettingresponse')); + // // console.log("TPMLNdexHOC"); + // // console.log(chromesettingArray); + // // console.log(chromesettingresponseArray); + // this.setState({ + // mygetHelmetapi:chromesettingArray + // }); + // if (chromesettingArray.tab_logo_url) { + // this.gettablogourldata(chromesettingresponseArray); + // } else { + // this.gettablogourlnull(); + // } + // }catch (e) { + // console.log("hoc获取游览器配置失败 重新请求开始读取配置"); + // this.getAppdatausr(); + // } - }; - getAppdatausr=()=>{ - let url = "/setting.json"; - axios.get(url).then((response) => { - // console.log("app.js开始请求/setting.json"); - // console.log("获取当前定制信息"); - if (response) { - if (response.data) { - this.setState({ - mygetHelmetapi: response.data.setting - }); - localStorage.setItem('chromesetting',JSON.stringify(response.data.setting)); - localStorage.setItem('chromesettingresponse',JSON.stringify(response)); - try { - if (response.data.setting.tab_logo_url) { - this.gettablogourldata(response); - } else { - this.gettablogourlnull(); - } - } catch (e) { - this.gettablogourlnull(); - } + // }; + // getAppdatausr=()=>{ + // let url = "/setting.json"; + // axios.get(url).then((response) => { + // // console.log("app.js开始请求/setting.json"); + // // console.log("获取当前定制信息"); + // if (response) { + // if (response.data) { + // this.setState({ + // mygetHelmetapi: response.data.setting + // }); + // localStorage.setItem('chromesetting',JSON.stringify(response.data.setting)); + // localStorage.setItem('chromesettingresponse',JSON.stringify(response)); + // try { + // if (response.data.setting.tab_logo_url) { + // this.gettablogourldata(response); + // } else { + // this.gettablogourlnull(); + // } + // } catch (e) { + // this.gettablogourlnull(); + // } - } else { + // } else { - this.gettablogourlnull(); + // this.gettablogourlnull(); - } + // } - } else { - this.gettablogourlnull(); + // } else { + // this.gettablogourlnull(); - } + // } - }).catch((error) => { - this.gettablogourlnull(); + // }).catch((error) => { + // this.gettablogourlnull(); - }); + // }); - } + // } fetchUser = () => { let url = `/users/get_user_info.json`