diff --git a/README.md b/README.md
index 8dcb6d131..90f519de4 100644
--- a/README.md
+++ b/README.md
@@ -1,69 +1,70 @@
-# README
-
-This README would normally document whatever steps are necessary to get the
-application up and running.
-
-Things you may want to cover:
-
-* Ruby version
-
-* System dependencies
-
-* Configuration
-
-* Database creation
-
-* Database initialization
-
-* How to run the test suite
-
-* Services (job queues, cache servers, search engines, etc.)
-
-* Deployment instructions
-
-* ...
-#### Jbuilder介绍
-Jbuilder: https://github.com/rails/jbuilder
-
-#### Rails5 介绍
-rails guide: https://ruby-china.github.io/rails-guides/v5.0/
-
-#### API设计文档
-doc for api: https://www.showdoc.cc/web/#/127895880302646?page_id=729221359592009
-user:Hjqreturn PW:12345678
-
-#### 测试版访问地址:https://testeduplus2.educoder.net
-
-#### 实训平台繁忙
- 仓库异常:繁忙等级(81)
-
-#### 新版域名跳转规则
-新版域名要求总结:testeduplus2.educoder.net/(主要提供实训、实训课堂等业务)
-目前有两个域名testbdweb.educoder.net(老版:主要提供课堂、项目、个人主页、后台等服务)
-
-要求:
-1、两服务域名都应该启动‘提供服务
-
-2、如果请求链接包含以下的形式,则域名跳至testeduplus2.educoder.net
-testeduplus2.educoder.net/shixuns
-testeduplus2.educoder.net/shixuns/*
-testeduplus2.educoder.net/paths
-testeduplus2.educoder.net/paths/*
-testeduplus2.educoder.net/myshixuns/
-testeduplus2.educoder.net/tasks/*
-testeduplus2.educoder.net/games/*
-
-如果不满足上述需求的,域名全部跳转至testbdweb.educoder.net
-比如:门户首页,如果访问:testeduplus2.educoder.net 应为没包含上述链接。则调制testbdweb.educoder.net
-在比如:testeduplus2.educoder.net /users/Hjqreturn没包含上述规则,则跳转到testbdweb.educoder.net/users/Hjqreturn
-
-
-# 需要重构user_extensions 相关sql语句的地方标记 REDO:Extention
-
-# 文件上传:ActiveStorage
-# 新能:bootsnap
-
-# 注意事项:
-# 第一次部署需要执行一些rake任务
-# 配置redis地址
+# README
+https://www.trustie.net/issues/24719
+[云上实验室] Logo、导航、底部备案信息定制化
+This README would normally document whatever steps are necessary to get the
+application up and running.
+
+Things you may want to cover:
+
+* Ruby version
+
+* System dependencies
+
+* Configuration
+
+* Database creation
+
+* Database initialization
+
+* How to run the test suite
+
+* Services (job queues, cache servers, search engines, etc.)
+
+* Deployment instructions
+
+* ...
+#### Jbuilder介绍
+Jbuilder: https://github.com/rails/jbuilder
+
+#### Rails5 介绍
+rails guide: https://ruby-china.github.io/rails-guides/v5.0/
+
+#### API设计文档
+doc for api: https://www.showdoc.cc/web/#/127895880302646?page_id=729221359592009
+user:Hjqreturn PW:12345678
+
+#### 测试版访问地址:https://testeduplus2.educoder.net
+
+#### 实训平台繁忙
+ 仓库异常:繁忙等级(81)
+
+#### 新版域名跳转规则
+新版域名要求总结:testeduplus2.educoder.net/(主要提供实训、实训课堂等业务)
+目前有两个域名testbdweb.educoder.net(老版:主要提供课堂、项目、个人主页、后台等服务)
+
+要求:
+1、两服务域名都应该启动‘提供服务
+
+2、如果请求链接包含以下的形式,则域名跳至testeduplus2.educoder.net
+testeduplus2.educoder.net/shixuns
+testeduplus2.educoder.net/shixuns/*
+testeduplus2.educoder.net/paths
+testeduplus2.educoder.net/paths/*
+testeduplus2.educoder.net/myshixuns/
+testeduplus2.educoder.net/tasks/*
+testeduplus2.educoder.net/games/*
+
+如果不满足上述需求的,域名全部跳转至testbdweb.educoder.net
+比如:门户首页,如果访问:testeduplus2.educoder.net 应为没包含上述链接。则调制testbdweb.educoder.net
+在比如:testeduplus2.educoder.net /users/Hjqreturn没包含上述规则,则跳转到testbdweb.educoder.net/users/Hjqreturn
+
+
+# 需要重构user_extensions 相关sql语句的地方标记 REDO:Extention
+
+# 文件上传:ActiveStorage
+# 新能:bootsnap
+
+# 注意事项:
+# 第一次部署需要执行一些rake任务
+# 配置redis地址
# 配置gitlab/intializers/gitlab_config.yml
\ No newline at end of file
diff --git a/public/react/public/index.html b/public/react/public/index.html
index f6eef196a..9b757d2c4 100755
--- a/public/react/public/index.html
+++ b/public/react/public/index.html
@@ -13,7 +13,7 @@
-
+
-
EduCoder
+
+
diff --git a/public/react/src/App.js b/public/react/src/App.js
index 34b5d1a4f..fd945914a 100644
--- a/public/react/src/App.js
+++ b/public/react/src/App.js
@@ -9,7 +9,7 @@ import {
Route,
Switch
} from 'react-router-dom';
-
+import axios from 'axios';
import '@icedesign/base/dist/ICEDesignBase.css';
import '@icedesign/base/index.scss';
@@ -287,6 +287,7 @@ class App extends Component {
Addcoursestypes:false,
mydisplay:false,
occupation:0,
+ mygetHelmetapi:undefined,
}
}
@@ -327,7 +328,6 @@ class App extends Component {
}
componentDidMount() {
this.disableVideoContextMenu();
-
// force an update if the URL changes
history.listen(() => {
this.forceUpdate()
@@ -336,7 +336,8 @@ class App extends Component {
$("html").animate({ scrollTop: $('html').scrollTop() - 0 })
});
- initAxiosInterceptors(this.props)
+ initAxiosInterceptors(this.props);
+ this.getAppdata();
//
// axios.interceptors.response.use((response) => {
// // console.log("response"+response);
@@ -362,15 +363,78 @@ class App extends Component {
this.setState({
isRender:false,
})
- }
-
- render() {
+ };
+ //获取当前定制信息
+ getAppdata=()=>{
+ 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
+ });
+ document.title = response.data.setting.name;
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = '/'+response.data.setting.tab_logo_url;
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ }else {
+ document.title = "EduCoder";
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = "/react/build/./favicon.ico";
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ }
+
+ }else{
+ document.title = "EduCoder";
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = "/react/build/./favicon.ico";
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ }
+ }).catch((error) => {
+ document.title = "EduCoder";
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = "/react/build/./favicon.ico";
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ });
+ };
+ render() {
+ let{mygetHelmetapi}=this.state;
+ // console.log("appappapp");
+ // console.log(mygetHelmetapi);
return (
+
+
this.Modifyloginvalue()}>
@@ -413,10 +477,22 @@ class App extends Component {
{
+
+ return ()
+ }
+ }
/>
{
+
+ return ()
+ }
+ }
/>
{
+
+ return ()
+ }
+ }
/>
{/*课堂*/}
-
+
{/*
*/}
@@ -502,7 +584,12 @@ class App extends Component {
render={
(props)=>()
}/>
-
+ ()
+ }
+ />
@@ -625,4 +712,4 @@ moment.defineLocale('zh-cn', {
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
-export default SnackbarHOC()(App);
\ No newline at end of file
+export default SnackbarHOC()(App) ;
\ No newline at end of file
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index e1d5da561..cddea79a6 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -93,10 +93,14 @@ export function initAxiosInterceptors(props) {
config.url = url;
}
}
-
- if (requestMap[config.url] === true) { // 避免重复的请求
- return false;
- }
+ //
+ // if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
+ // console.log(config);
+ // console.log(JSON.parse(config));
+ // console.log(config.url);
+ // console.log("被阻止了是重复请求=================================");
+ // return false;
+ // }
// 非file_update请求
if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true;
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
index 438c07aeb..e1a1f17f9 100644
--- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
+++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
@@ -2663,6 +2663,9 @@ class Studentshavecompletedthelist extends Component {
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;}
}
+ .ysltableows2 .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
+ padding: 9px;
+ }
`}
{data === undefined ? "" :
div > .ant-spin .ant-spin-dot {
top: 72%;}
}
+ .ysltableows2 .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
+ padding: 9px;
+ }
`}
-
+
{datas === undefined ? "" :
{
- // console.log("Commonheadofthetestpaper");
+ console.log("Commonheadofthetestpaper 试卷公用头部");
var exercise_id = this.props.match.params.Id;
var url = `/exercises/${exercise_id}/common_header.json`;
axios.get(url).then((response) => {
@@ -249,6 +249,19 @@ class Testpapersettinghomepage extends Component{
// DownloadMessageval:undefined
// })
// }
+ getsetdata =()=>{
+ // console.log("Testpapersettinghomepage");
+ // console.log("getsetdatassssss");
+ let{tab}=this.state;
+ try {
+ if(tab[0]==="0"){
+ this.child.Teacherliststudentlist();
+ }
+ }catch (e) {
+
+ }
+
+ }
bindRef = ref => { this.child = ref };
goback=()=>{
// let {datalist}=this.state;
@@ -410,6 +423,7 @@ class Testpapersettinghomepage extends Component{
Exercisetype={"exercise"}
action={this.Commonheadofthetestpaper}
single={true}
+ getsetdata={this.getsetdata}
>
:"":""}
{isAdmin === true? 编辑试卷:""}
diff --git a/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js b/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js
index c7585a390..9644acfde 100644
--- a/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js
+++ b/public/react/src/modules/courses/poll/pollPublicBtn/ImmediatelyPublish.js
@@ -89,6 +89,7 @@ class Immediatelypublish extends Component{
Cancel:this.homeworkhide,
Saves:this.homeworkstartend,
})
+
}
}).catch((error) => {
console.log(error)
@@ -135,7 +136,8 @@ class Immediatelypublish extends Component{
}
- }
+ }
+
}
//取消提示弹框
@@ -189,7 +191,18 @@ class Immediatelypublish extends Component{
this.homeworkhide();
// 调用父级公共头部的接口刷新
- this.props.action()
+ try {
+ this.props.action();
+ }catch (e) {
+
+ }
+ // 调用父级刷新数据的接口刷新
+ try {
+ this.props.getsetdata()
+ }catch (e) {
+
+ }
+
}
}).catch((error)=>{
console.log(error);
@@ -274,7 +287,7 @@ class Immediatelypublish extends Component{
modalSave={this.modalCancel}
>
- 立即发布
+ this.homeworkstart()}>立即发布
)
}
diff --git a/public/react/src/modules/forums/MemoTechShare.js b/public/react/src/modules/forums/MemoTechShare.js
index de6ba074c..d32bd2e2f 100644
--- a/public/react/src/modules/forums/MemoTechShare.js
+++ b/public/react/src/modules/forums/MemoTechShare.js
@@ -1,116 +1,116 @@
-import React, { Component } from 'react';
-import { Redirect } from 'react-router';
-
-import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
-
-import PropTypes from 'prop-types';
-
-import classNames from 'classnames'
-
-import Pagination from 'rc-pagination';
-
-import { postPaginationHOC } from './PostPaginationHOC'
-
-import PostItem from './PostItem'
-
-import ForumsNavTab from './ForumsNavTab'
-
-// import queryString from 'query-string'
-import { queryString } from 'educoder'
-
-import MemoList from './MemoList'
-
-
-class MemoTechShare extends Component {
- constructor(props) {
- super(props)
-
- this.handleLocationChange = this.handleLocationChange.bind(this);
-
- this.state = {
-
- }
- }
-
- onPaginationChange(pageNum, pageSize) {
- this.props.onPaginationChange(pageNum, pageSize)
- }
-
- componentDidMount() {
- // this.handleLocationChange(this.props.history.location);
- // this.unlisten = this.props.history.listen(this.handleLocationChange);
- }
-
- componentWillUnmount() {
- // this.unlisten();
- }
- componentDidUpdate(prevProps) {
- if(this.props.match.params.memoType !== prevProps.match.params.memoType) {
- // do something
- console.log(`memoType changed`)
- this.props.fetchMemos();
- }
- }
-
- componentWillReceiveProps(newProps, newContext) {
- if (newProps.match.url === this.props.match.url) {
- const oldParsed = queryString.parse(this.props.location.search);
- const newParsed = queryString.parse(newProps.location.search);
- if (!newParsed.page && oldParsed.page ||
- (oldParsed.order && newParsed.order && oldParsed.order != newParsed.order)) {
- this.props.fetchMemos();
- }
- console.log('componentWillReceiveProps...')
- }
- }
-
- handleLocationChange(location) {
- console.log(`- - - location: '${location.pathname}'`);
- if (location.pathname) {
- if (location.pathname.indexOf('/forums/categories/all') != -1
- && this.props.location.search && this.props.location.search.indexOf('order=') != -1
- && location.search.indexOf('order=') != -1) {
- const oldParsed = queryString.parse(this.props.location.search);
- const newParsed = queryString.parse(location.search);
- if (oldParsed.order != newParsed.order) { // 只有在热门和最新间跳转时,才需要处理
- this.props.fetchMemos();
- }
- }
- }
- }
-
- renderMemoList() {
-
-
- // const { memo_list, user } = this.props;
- // if (!memo_list) {
- // return ''
- // }
- // return memo_list.map( (item, index) => {
-
- // return (
- // this.setTop(memo)}
- // setDown={(memo)=>this.setDown(memo)} memo={item}
- // >
- // )
- // })
- return this.props.renderMemoList();
- }
-
- render() {
- const { match, history, currentPage, memo_count ,memo_list } = this.props
-
- return (
-
-
- this.renderMemoList()}
- onPaginationChange={ (pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize) }
- >
-
-
- );
- }
-}
-
-export default postPaginationHOC() ( MemoTechShare );
+import React, { Component } from 'react';
+import { Redirect } from 'react-router';
+
+import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
+
+import PropTypes from 'prop-types';
+
+import classNames from 'classnames'
+
+import Pagination from 'rc-pagination';
+
+import { postPaginationHOC } from './PostPaginationHOC'
+
+import PostItem from './PostItem'
+
+import ForumsNavTab from './ForumsNavTab'
+
+// import queryString from 'query-string'
+import { queryString } from 'educoder'
+
+import MemoList from './MemoList'
+
+
+class MemoTechShare extends Component {
+ constructor(props) {
+ super(props)
+
+ this.handleLocationChange = this.handleLocationChange.bind(this);
+
+ this.state = {
+
+ }
+ }
+
+ onPaginationChange(pageNum, pageSize) {
+ this.props.onPaginationChange(pageNum, pageSize)
+ }
+
+ componentDidMount() {
+ // this.handleLocationChange(this.props.history.location);
+ // this.unlisten = this.props.history.listen(this.handleLocationChange);
+ }
+
+ componentWillUnmount() {
+ // this.unlisten();
+ }
+ componentDidUpdate(prevProps) {
+ if(this.props.match.params.memoType !== prevProps.match.params.memoType) {
+ // do something
+ console.log(`memoType changed`)
+ this.props.fetchMemos();
+ }
+ }
+
+ componentWillReceiveProps(newProps, newContext) {
+ if (newProps.match.url === this.props.match.url) {
+ const oldParsed = queryString.parse(this.props.location.search);
+ const newParsed = queryString.parse(newProps.location.search);
+ if (!newParsed.page && oldParsed.page ||
+ (oldParsed.order && newParsed.order && oldParsed.order != newParsed.order)) {
+ this.props.fetchMemos();
+ }
+ // console.log('componentWillReceiveProps...')
+ }
+ }
+
+ handleLocationChange(location) {
+ console.log(`- - - location: '${location.pathname}'`);
+ if (location.pathname) {
+ if (location.pathname.indexOf('/forums/categories/all') != -1
+ && this.props.location.search && this.props.location.search.indexOf('order=') != -1
+ && location.search.indexOf('order=') != -1) {
+ const oldParsed = queryString.parse(this.props.location.search);
+ const newParsed = queryString.parse(location.search);
+ if (oldParsed.order != newParsed.order) { // 只有在热门和最新间跳转时,才需要处理
+ this.props.fetchMemos();
+ }
+ }
+ }
+ }
+
+ renderMemoList() {
+
+
+ // const { memo_list, user } = this.props;
+ // if (!memo_list) {
+ // return ''
+ // }
+ // return memo_list.map( (item, index) => {
+
+ // return (
+ // this.setTop(memo)}
+ // setDown={(memo)=>this.setDown(memo)} memo={item}
+ // >
+ // )
+ // })
+ return this.props.renderMemoList();
+ }
+
+ render() {
+ const { match, history, currentPage, memo_count ,memo_list } = this.props
+
+ return (
+
+
+ this.renderMemoList()}
+ onPaginationChange={ (pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize) }
+ >
+
+
+ );
+ }
+}
+
+export default postPaginationHOC() ( MemoTechShare );
diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js
index a6600b1e0..680c4bbc7 100644
--- a/public/react/src/modules/login/EducoderLogin.js
+++ b/public/react/src/modules/login/EducoderLogin.js
@@ -19,6 +19,8 @@ import {
notification
} from "antd";
import {Link, Switch, Route, Redirect} from 'react-router-dom';
+import { SnackbarHOC,getImageUrl } from 'educoder';
+import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import '../courses/css/members.css';
import "../courses/common/formCommon.css"
import '../courses/css/Courses.css';
@@ -108,7 +110,8 @@ class EducoderLogin extends Component {
}
componentDidMount() {
-
+ // console.log("EducoderLogin");
+ // console.log(this.props);
}
Setlogins=(i)=>{
@@ -137,6 +140,9 @@ class EducoderLogin extends Component {
render() {
let {showbool,loginstatus,logini} = this.state;
+ console.log("EducoderLogingetHelmetapi");
+ console.log(this.props);
+ // console.log(this.props.mygetHelmetapi);
return (
@@ -148,7 +154,13 @@ class EducoderLogin extends Component {
"width": "100%"
}}>
-
this.gohome()} src={educodernet}/>
+ {
+ this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.login_logo_url===null|| this.props.mygetHelmetapi.login_logo_url===undefined?
+
this.gohome()} src={educodernet}/>
+ :
+
this.gohome()} src={getImageUrl(this.props.mygetHelmetapi.login_logo_url)}/>
+ }
+
@@ -196,8 +208,7 @@ class EducoderLogin extends Component {
}
}
-
-export default EducoderLogin;
+export default EducoderLogin ;
// showbool === 2 ?
//
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js
index de8fade26..330573f81 100644
--- a/public/react/src/modules/tpm/NewHeader.js
+++ b/public/react/src/modules/tpm/NewHeader.js
@@ -65,13 +65,26 @@ class NewHeader extends Component {
showTrial:false,
setevaluatinghides:false,
occupation:0,
- mydisplay:false
+ mydisplay:false,
+ headtypesonClickbool:false,
+ headtypess:"/",
+ mygetHelmetapi2:undefined,
}
- // console.log("176")
+ 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();
window._header_componentHandler = this;
//下拉框的显示隐藏
@@ -633,11 +646,80 @@ submittojoinclass=(value)=>{
this.setState({
AccountProfiletype:false
})
+ };
+ headtypesonClick=(url,bool)=>{
+ this.setState({
+ headtypess:url,
+ headtypesonClickbool:bool,
+ })
}
+ getAppdata=()=>{
+ // console.log("开始刷新数据了")
+ let url = "/setting.json";
+ axios.get(url).then((response) => {
+ // console.log("axios.get");
+ // console.log(response);
+
+ if(response){
+ if(response.data){
+ this.setState({
+ mygetHelmetapi2:response.data.setting
+ });
+ document.title = response.data.setting.name;
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = '/'+response.data.setting.tab_logo_url;
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ }else {
+ document.title = "EduCoder";
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = "/react/build/./favicon.ico";
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ }
+ }else{
+ document.title = "EduCoder";
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = "/react/build/./favicon.ico";
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ }
+
+ }).catch((error) => {
+ console.log("开始刷新定制数据了但报错了");
+ console.log(error);
+
+ document.title = "EduCoder";
+ var link = document.createElement('link'),
+ oldLink = document.getElementById('dynamic-favicon');
+ link.id = 'dynamic-favicon';
+ link.rel = 'shortcut icon';
+ link.href = "/react/build/./favicon.ico";
+ if (oldLink) {
+ document.head.removeChild(oldLink);
+ }
+ document.head.appendChild(link);
+ });
+ };
render() {
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
- const {match ,} = this.props;
+ const {match,} = this.props;
let {Addcoursestypes,
tojoinitemtype,
@@ -655,35 +737,127 @@ submittojoinclass=(value)=>{
user,
isRender,
showSearchOpentype,
+ headtypesonClickbool,
+ headtypess,
+ mygetHelmetapi2,
}=this.state;
/*
用户名称 用户头像url
*/
- let activeIndex = false;
- let activeForums = false;
- let activeShixuns = false;
- let activePaths = false;
- let coursestype=false;
+ let activeIndex = false;
+ let activeForums = false;
+ let activeShixuns = false;
+ let activePaths = false;
+ let coursestype=false;
let activePackages=false;
let activeMoopCases=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')) {
+ 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 {
- activeIndex = true;
- }
+ }else if(match.path.startsWith('/moop_cases')){
+ activeMoopCases = true;
+ }else {
+ activeIndex = true;
+ }
+ let headtypes='/';
+
+ // console.log("mygetHelmetapi2");
+ // console.log(mygetHelmetapi2);
+ if(mygetHelmetapi2){
+ if(mygetHelmetapi2.navbar){
+ if(mygetHelmetapi2.navbar.length>0){
+ // console.log("mygetHelmetapi2.navbar.length>0====-=-=--=-=-=-=");
+ //
+ // console.log(match.path);
+ if(match.path==='/'){
+ if(headtypesonClickbool===false){
+ headtypes=undefined;
+ }else{
+ headtypes=headtypess;
+ }
+
+ }else {
+ for(var i=0;i