Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

competitions
杨树明 5 years ago
commit ae9e878f42

@ -1,5 +1,6 @@
# README # README
https://www.trustie.net/issues/24719
[云上实验室] Logo、导航、底部备案信息定制化
This README would normally document whatever steps are necessary to get the This README would normally document whatever steps are necessary to get the
application up and running. application up and running.

@ -0,0 +1,15 @@
class Admins::CompetitionsController < Admins::BaseController
def index
params[:sort_by] = params[:sort_by].presence || 'created_on'
params[:sort_direction] = params[:sort_direction].presence || 'desc'
@competitions = custom_sort Competition.all, params[:sort_by], params[:sort_direction]
@params_page = params[:page] || 1
@competitions = paginate @competitions
respond_to do |format|
format.js
format.html
end
end
end

@ -2,7 +2,7 @@ class BoardsController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
before_action :find_course, only: [:create] before_action :find_course, only: [:create]
before_action :set_board, except: [:create] before_action :set_board, except: [:create]
before_action :teacher_or_admin_allowed before_action :teacher_allowed
def index def index
@boards = @course.boards.includes(messages: [:last_reply, :author]) @boards = @course.boards.includes(messages: [:last_reply, :author])

@ -2,7 +2,7 @@ class CourseGroupsController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
before_action :set_group, except: [:create] before_action :set_group, except: [:create]
before_action :find_course, only: [:create] before_action :find_course, only: [:create]
before_action :teacher_or_admin_allowed before_action :teacher_allowed
def create def create
tip_exception("分班名称不能为空") if params[:name].blank? tip_exception("分班名称不能为空") if params[:name].blank?

@ -2,7 +2,8 @@ class CourseModulesController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
before_action :set_module, except: [:unhidden_modules] before_action :set_module, except: [:unhidden_modules]
before_action :find_course, only: [:unhidden_modules] before_action :find_course, only: [:unhidden_modules]
before_action :teacher_or_admin_allowed before_action :teacher_or_admin_allowed, except: [:add_second_category]
before_action :teacher_allowed, only: [:add_second_category]
# 模块置顶 # 模块置顶
def sticky_module def sticky_module

@ -1,7 +1,7 @@
class CourseSecondCategoriesController < ApplicationController class CourseSecondCategoriesController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
before_action :set_category before_action :set_category
before_action :teacher_or_admin_allowed before_action :teacher_allowed
# 目录重命名 # 目录重命名
def rename_category def rename_category

@ -98,7 +98,7 @@ class Attachment < ApplicationRecord
def become_history def become_history
history = self.attachment_histories.first history = self.attachment_histories.first
new_attachment_history = AttachmentHistory.new(self.attributes.except("id", "resource_bank_id", "unified_setting", "course_second_category_id").merge( new_attachment_history = AttachmentHistory.new(self.attributes.except("id", "resource_bank_id", "unified_setting", "course_second_category_id", "delay_publish").merge(
attachment_id: self.id, attachment_id: self.id,
version: history.nil? ? 1 : history.version + 1, version: history.nil? ? 1 : history.version + 1,
)) ))
@ -106,7 +106,7 @@ class Attachment < ApplicationRecord
end end
def copy_attributes_from_new_attachment(new_attachment) def copy_attributes_from_new_attachment(new_attachment)
self.attributes = new_attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes",'is_publish','publish_time') self.attributes = new_attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes",'is_publish','publish_time', "delay_publish")
end end
def set_public(is_public) def set_public(is_public)

@ -0,0 +1,3 @@
class CompetitionModeSetting < ApplicationRecord
belongs_to :course
end

@ -0,0 +1,7 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('竞赛列表', admins_competitions_path) %>
<% end %>
<div class="box competitions-list-container">
<%= render partial: 'admins/shixuns/shared/list', locals: { shixuns: @shixuns } %>
</div>

@ -66,6 +66,8 @@
<% end %> <% end %>
</li> </li>
<li><%= sidebar_item(admins_competitions_path, '竞赛', icon: 'trophy', controller: 'admins-competitions') %></li>
<li> <li>
<%= sidebar_item_group('#setting-submenu', '网站建设', icon: 'cogs') do %> <%= sidebar_item_group('#setting-submenu', '网站建设', icon: 'cogs') do %>
<li><%= sidebar_item(admins_carousels_path, '轮播图', icon: 'image', controller: 'admins-carousels') %></li> <li><%= sidebar_item(admins_carousels_path, '轮播图', icon: 'image', controller: 'admins-carousels') %></li>

@ -20,7 +20,7 @@ json.competitions do
if section if section
json.current_stage do json.current_stage do
json.name = section.competition_stage.name json.name section.competition_stage.name
json.start_time section.display_start_time json.start_time section.display_start_time
json.end_time section.display_end_time json.end_time section.display_end_time
end end

@ -1,5 +1,6 @@
json.partial! "commons/success" json.partial! "commons/success"
json.data do json.data @courses do |course|
json.array! @courses, :id, :name, :updated_at, :created_at, :end_date json.(course, :id, :name, :updated_at, :end_date)
json.created_at course.created_at.strftime("%Y-%m-%d")
end end

@ -980,6 +980,8 @@ Rails.application.routes.draw do
resource :laboratory_setting, only: [:show, :update] resource :laboratory_setting, only: [:show, :update]
resource :laboratory_user, only: [:create, :destroy] resource :laboratory_user, only: [:create, :destroy]
end end
resources :competitions, only: [:index, :destroy]
end end
resources :colleges, only: [] do resources :colleges, only: [] do

@ -0,0 +1,6 @@
class AddNewColumnToCompetitions < ActiveRecord::Migration[5.2]
def change
add_column :competitions, :bonus, :integer, default: 0
add_column :competitions, :mode, :integer, default: 0
end
end

@ -0,0 +1,11 @@
class CreateCompetitionModeSettings < ActiveRecord::Migration[5.2]
def change
create_table :competition_mode_settings do |t|
t.references :course
t.datetime :start_time
t.datetime :end_time
t.timestamps
end
end
end

@ -13,7 +13,7 @@
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> <!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">-->
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
@ -23,7 +23,8 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>EduCoder</title> <!-- <title>EduCoder</title>-->
<!--react-ssr-head-->
<script type="text/javascript"> <script type="text/javascript">
window.__isR = true; window.__isR = true;

@ -10,7 +10,7 @@
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/ homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> <link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> <!-- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">-->
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
@ -20,7 +20,8 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>Educoder</title> <!-- <title>Educoder</title>-->
<!--react-ssr-head-->
<script type="text/javascript"> <script type="text/javascript">
window.__isR = true; window.__isR = true;
</script> </script>

@ -9,7 +9,7 @@ import {
Route, Route,
Switch Switch
} from 'react-router-dom'; } from 'react-router-dom';
import axios from 'axios';
import '@icedesign/base/dist/ICEDesignBase.css'; import '@icedesign/base/dist/ICEDesignBase.css';
import '@icedesign/base/index.scss'; import '@icedesign/base/index.scss';
@ -287,6 +287,7 @@ class App extends Component {
Addcoursestypes:false, Addcoursestypes:false,
mydisplay:false, mydisplay:false,
occupation:0, occupation:0,
mygetHelmetapi:undefined,
} }
} }
@ -327,7 +328,6 @@ class App extends Component {
} }
componentDidMount() { componentDidMount() {
this.disableVideoContextMenu(); this.disableVideoContextMenu();
// force an update if the URL changes // force an update if the URL changes
history.listen(() => { history.listen(() => {
this.forceUpdate() this.forceUpdate()
@ -336,7 +336,8 @@ class App extends Component {
$("html").animate({ scrollTop: $('html').scrollTop() - 0 }) $("html").animate({ scrollTop: $('html').scrollTop() - 0 })
}); });
initAxiosInterceptors(this.props) initAxiosInterceptors(this.props);
this.getAppdata();
// //
// axios.interceptors.response.use((response) => { // axios.interceptors.response.use((response) => {
// // console.log("response"+response); // // console.log("response"+response);
@ -362,15 +363,78 @@ class App extends Component {
this.setState({ this.setState({
isRender:false, isRender:false,
}) })
};
//获取当前定制信息
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);
} }
render() { }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 ( return (
<LocaleProvider locale={zhCN}> <LocaleProvider locale={zhCN}>
<MuiThemeProvider theme={theme}> <MuiThemeProvider theme={theme}>
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={()=>this.Modifyloginvalue()}></LoginDialog> <LoginDialog {...this.props} {...this.state} Modifyloginvalue={()=>this.Modifyloginvalue()}></LoginDialog>
<Notcompletedysl {...this.props} {...this.state}></Notcompletedysl> <Notcompletedysl {...this.props} {...this.state}></Notcompletedysl>
@ -413,10 +477,22 @@ class App extends Component {
<Route path="/compatibility" component={CompatibilityPageLoadable}/> <Route path="/compatibility" component={CompatibilityPageLoadable}/>
<Route <Route
path="/login" component={EducoderLogin} path="/login"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/> />
<Route <Route
path="/register" component={EducoderLogin} path="/register"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/> />
<Route <Route
path="/otherloginstart" component={Otherloginstart} path="/otherloginstart" component={Otherloginstart}
@ -440,7 +516,13 @@ class App extends Component {
}></Route> }></Route>
<Route <Route
path="/changepassword" component={EducoderLogin} path="/changepassword"
render={
(props) => {
return (<EducoderLogin {...this.props} {...props} {...this.state} />)
}
}
/> />
<Route <Route
path="/interesse" component={Interestpage} path="/interesse" component={Interestpage}
@ -468,7 +550,7 @@ class App extends Component {
></Route> ></Route>
{/*课堂*/} {/*课堂*/}
<Route path="/courses" component={CoursesIndex} {...this.props}></Route> <Route path="/courses" component={CoursesIndex} {...this.props} {...this.state}></Route>
{/* <Route path="/forums" component={ForumsIndexComponent}> {/* <Route path="/forums" component={ForumsIndexComponent}>
</Route> */} </Route> */}
@ -502,7 +584,12 @@ class App extends Component {
render={ render={
(props)=>(<Ecs {...this.props} {...props} {...this.state}></Ecs>) (props)=>(<Ecs {...this.props} {...props} {...this.state}></Ecs>)
}/> }/>
<Route exact path="/" component={ShixunsHome}/> <Route exact path="/"
// component={ShixunsHome}
render={
(props)=>(<ShixunsHome {...this.props} {...props} {...this.state}></ShixunsHome>)
}
/>
<Route component={Shixunnopage}/> <Route component={Shixunnopage}/>

@ -94,9 +94,15 @@ export function initAxiosInterceptors(props) {
} }
} }
if (requestMap[config.url] === true) { // 避免重复的请求 if (config.method === "post") {
if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息定制信息是get 请求
// console.log(config);
// console.log(JSON.parse(config));
// console.log(config.url);
// console.log("被阻止了是重复请求=================================");
return false; return false;
} }
}
// 非file_update请求 // 非file_update请求
if (config.url.indexOf('update_file') === -1) { if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true; requestMap[config.url] = true;

@ -2663,6 +2663,9 @@ class Studentshavecompletedthelist extends Component {
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;} top: 72%;}
} }
.ysltableows2 .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 9px;
}
`}</style> `}</style>
<div className="edu-table edu-back-white"> <div className="edu-table edu-back-white">
{data === undefined ? "" : <Table {data === undefined ? "" : <Table
@ -2767,8 +2770,11 @@ class Studentshavecompletedthelist extends Component {
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot { .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;} top: 72%;}
} }
.ysltableows2 .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 9px;
}
`}</style> `}</style>
<div className="edu-table edu-back-white minH-560"> <div className="edu-table edu-back-white minH-560 ysltableows2">
{datas === undefined ? "" : <Table {datas === undefined ? "" : <Table
dataSource={datas} dataSource={datas}
columns={columnss} columns={columnss}

@ -61,7 +61,7 @@ class Testpapersettinghomepage extends Component{
} }
//试卷公用头部 //试卷公用头部
Commonheadofthetestpaper=()=>{ Commonheadofthetestpaper=()=>{
// console.log("Commonheadofthetestpaper"); console.log("Commonheadofthetestpaper 试卷公用头部");
var exercise_id = this.props.match.params.Id; var exercise_id = this.props.match.params.Id;
var url = `/exercises/${exercise_id}/common_header.json`; var url = `/exercises/${exercise_id}/common_header.json`;
axios.get(url).then((response) => { axios.get(url).then((response) => {
@ -249,6 +249,19 @@ class Testpapersettinghomepage extends Component{
// DownloadMessageval:undefined // 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 }; bindRef = ref => { this.child = ref };
goback=()=>{ goback=()=>{
// let {datalist}=this.state; // let {datalist}=this.state;
@ -410,6 +423,7 @@ class Testpapersettinghomepage extends Component{
Exercisetype={"exercise"} Exercisetype={"exercise"}
action={this.Commonheadofthetestpaper} action={this.Commonheadofthetestpaper}
single={true} single={true}
getsetdata={this.getsetdata}
></ImmediatelyPublish> ></ImmediatelyPublish>
:"":""} :"":""}
{isAdmin === true? <Link className="fr color-blue font-16 mt20 mr20" to={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>:""} {isAdmin === true? <Link className="fr color-blue font-16 mt20 mr20" to={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/edit`}>编辑试卷</Link>:""}

@ -6,7 +6,7 @@ import axios from 'axios'
/** /**
角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生
*/ */
function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification, getUserId, fetchUser }) { function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification, getUserId, fetchUser, style }) {
const [checkBoxRoles, setCheckBoxRoles] = useState(member_roles) const [checkBoxRoles, setCheckBoxRoles] = useState(member_roles)
// useEffect(() => { // useEffect(() => {
// if (checkBoxRoles.length != member_roles.length) { // 死循环 // if (checkBoxRoles.length != member_roles.length) { // 死循环
@ -75,7 +75,7 @@ function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSucces
</Checkbox.Group> </Checkbox.Group>
} }
> >
<WordsBtn style={'blue'} style2={props.style}>修改角色</WordsBtn> <WordsBtn style={'blue'} style2={style}>修改角色</WordsBtn>
</Popconfirm> </Popconfirm>
) )
} }

@ -320,6 +320,9 @@ class studentsList extends Component{
isAdmin && on('updateNavSuccess', this.updateNavSuccess) isAdmin && on('updateNavSuccess', this.updateNavSuccess)
} }
componentWillUnmount() { componentWillUnmount() {
if (this.clipboard) {
this.clipboard.destroy()
}
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
if (isAdmin) { if (isAdmin) {
off('addStudentSuccess', this.addStudentSuccessListener) off('addStudentSuccess', this.addStudentSuccessListener)
@ -420,6 +423,7 @@ class studentsList extends Component{
invite_code: result.data.invite_code, invite_code: result.data.invite_code,
isSpin:false isSpin:false
}, () => { }, () => {
if (course_group_id) {
if (!this.clipboard) { if (!this.clipboard) {
const clipboard = new ClipboardJS('.copybtn'); const clipboard = new ClipboardJS('.copybtn');
clipboard.on('success', (e) => { clipboard.on('success', (e) => {
@ -427,6 +431,7 @@ class studentsList extends Component{
}); });
this.clipboard = clipboard this.clipboard = clipboard
} }
}
}) })
} }
}).catch((error)=>{ }).catch((error)=>{
@ -598,7 +603,7 @@ class studentsList extends Component{
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('删除成功') this.props.showNotification('删除成功')
this.props.history.push(`/courses/${coursesId}/course_groups`) this.props.history.push(`/courses/${courseId}/course_groups`)
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -706,7 +711,7 @@ class studentsList extends Component{
<React.Fragment> <React.Fragment>
<span> <span>
<Tooltip title="返回"> <Tooltip title="返回">
<i className="icon-zuojiantou iconfont font-14" onClick={() => { this.props.history.push(`/courses/${coursesids}/course_groups`)}} <i className="icon-zuojiantou iconfont font-14" onClick={() => { this.props.history.push(`/courses/${courseId}/course_groups`)}}
style={{color: '#212121', verticalAlign: 'initial', marginRight: '14px' }} style={{color: '#212121', verticalAlign: 'initial', marginRight: '14px' }}
></i> ></i>
</Tooltip>{course_group_name || ''}</span> </Tooltip>{course_group_name || ''}</span>
@ -751,7 +756,7 @@ class studentsList extends Component{
!isStudentPage && !isCourseEnd && isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> } !isStudentPage && !isCourseEnd && isAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{ {
!isStudentPage && isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.addToDir()}>加入分班</WordsBtn> } !isStudentPage && isStudent && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="" onClick={()=>this.addToDir()}>加入分班</WordsBtn> }
<style>{` <style>{`
.drop_down_menu li a { .drop_down_menu li a {
padding: 0px; padding: 0px;

@ -89,6 +89,7 @@ class Immediatelypublish extends Component{
Cancel:this.homeworkhide, Cancel:this.homeworkhide,
Saves:this.homeworkstartend, Saves:this.homeworkstartend,
}) })
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -136,6 +137,7 @@ class Immediatelypublish extends Component{
} }
} }
} }
//取消提示弹框 //取消提示弹框
@ -189,7 +191,18 @@ class Immediatelypublish extends Component{
this.homeworkhide(); this.homeworkhide();
// 调用父级公共头部的接口刷新 // 调用父级公共头部的接口刷新
this.props.action() try {
this.props.action();
}catch (e) {
}
// 调用父级刷新数据的接口刷新
try {
this.props.getsetdata()
}catch (e) {
}
} }
}).catch((error)=>{ }).catch((error)=>{
console.log(error); console.log(error);
@ -274,7 +287,7 @@ class Immediatelypublish extends Component{
modalSave={this.modalCancel} modalSave={this.modalCancel}
></Modals> ></Modals>
<WordsBtn style={this.props.style} className={this.props.className} onClick={this.homeworkstart}>立即发布</WordsBtn> <WordsBtn style={this.props.style} className={this.props.className} onClick={()=>this.homeworkstart()}>立即发布</WordsBtn>
</React.Fragment> </React.Fragment>
) )
} }

@ -60,7 +60,7 @@ class MemoTechShare extends Component {
(oldParsed.order && newParsed.order && oldParsed.order != newParsed.order)) { (oldParsed.order && newParsed.order && oldParsed.order != newParsed.order)) {
this.props.fetchMemos(); this.props.fetchMemos();
} }
console.log('componentWillReceiveProps...') // console.log('componentWillReceiveProps...')
} }
} }

@ -19,6 +19,8 @@ import {
notification notification
} from "antd"; } from "antd";
import {Link, Switch, Route, Redirect} from 'react-router-dom'; 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/css/members.css';
import "../courses/common/formCommon.css" import "../courses/common/formCommon.css"
import '../courses/css/Courses.css'; import '../courses/css/Courses.css';
@ -108,7 +110,8 @@ class EducoderLogin extends Component {
} }
componentDidMount() { componentDidMount() {
// console.log("EducoderLogin");
// console.log(this.props);
} }
Setlogins=(i)=>{ Setlogins=(i)=>{
@ -137,6 +140,9 @@ class EducoderLogin extends Component {
render() { render() {
let {showbool,loginstatus,logini} = this.state; let {showbool,loginstatus,logini} = this.state;
console.log("EducoderLogingetHelmetapi");
console.log(this.props);
// console.log(this.props.mygetHelmetapi);
return ( return (
<div style={newContainer} className=" clearfix" > <div style={newContainer} className=" clearfix" >
@ -148,7 +154,13 @@ class EducoderLogin extends Component {
"width": "100%" "width": "100%"
}}> }}>
<div style={{cursor:"pointer"}}> <div style={{cursor:"pointer"}}>
{
this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.login_logo_url===null|| this.props.mygetHelmetapi.login_logo_url===undefined?
<img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={educodernet}/> <img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={educodernet}/>
:
<img style={{cursor:"pointer"}} onClick={()=>this.gohome()} src={getImageUrl(this.props.mygetHelmetapi.login_logo_url)}/>
}
</div> </div>
@ -196,7 +208,6 @@ class EducoderLogin extends Component {
} }
} }
export default EducoderLogin ; export default EducoderLogin ;
// showbool === 2 ? // showbool === 2 ?
// <div style={{ // <div style={{

@ -39,6 +39,8 @@ class NewFooter extends Component {
</ul> </ul>
</div> </div>
<div> <div>
{
this.props.mygetHelmetapi===undefined|| this.props.mygetHelmetapi.footer===null||this.props.mygetHelmetapi.footer===undefined?
<p className="footer_con-p inline lineh-30 font-14"> <p className="footer_con-p inline lineh-30 font-14">
<span className="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder <span className="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder
<a style={{"color":"#888"}} target="_blank" href="http://beian.miit.gov.cn/" className="ml15 mr15">湘ICP备17009477号</a> <a style={{"color":"#888"}} target="_blank" href="http://beian.miit.gov.cn/" className="ml15 mr15">湘ICP备17009477号</a>
@ -49,6 +51,11 @@ class NewFooter extends Component {
target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside. <span target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside. <span
className="mr15">版权所有 湖南智擎科技有限公司</span> className="mr15">版权所有 湖南智擎科技有限公司</span>
</p> </p>
:
<div dangerouslySetInnerHTML={{__html: this.props.mygetHelmetapi.footer}}></div>
}
</div> </div>
<div className="cl"></div> <div className="cl"></div>
</div> </div>

@ -65,13 +65,26 @@ class NewHeader extends Component {
showTrial:false, showTrial:false,
setevaluatinghides:false, setevaluatinghides:false,
occupation:0, occupation:0,
mydisplay:false mydisplay:false,
headtypesonClickbool:false,
headtypess:"/",
mygetHelmetapi2:undefined,
} }
// console.log("176") console.log("176")
// console.log(props); // 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() { componentDidMount() {
console.log("componentDidMount1");
this.getAppdata();
window._header_componentHandler = this; window._header_componentHandler = this;
//下拉框的显示隐藏 //下拉框的显示隐藏
@ -633,8 +646,77 @@ submittojoinclass=(value)=>{
this.setState({ this.setState({
AccountProfiletype:false 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() { render() {
const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 const isLogin = true; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。
const {match,} = this.props; const {match,} = this.props;
@ -655,6 +737,9 @@ submittojoinclass=(value)=>{
user, user,
isRender, isRender,
showSearchOpentype, showSearchOpentype,
headtypesonClickbool,
headtypess,
mygetHelmetapi2,
}=this.state; }=this.state;
/* /*
用户名称 用户头像url 用户名称 用户头像url
@ -684,6 +769,95 @@ submittojoinclass=(value)=>{
activeIndex = true; 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<mygetHelmetapi2.navbar.length;i++){
if(match.path===mygetHelmetapi2.navbar[i].link){
headtypes=mygetHelmetapi2.navbar[i].link;
break;
}
}
}
}else{
if (match.path === '/forums') {
headtypes = '/forums';
} else if (match.path.startsWith('/shixuns')) {
headtypes = '/shixuns';
}else if (match.path.startsWith('/paths')) {
headtypes = '/paths';
} else if (match.path.startsWith('/courses')) {
headtypes = '/courses';
}else if (match.path.startsWith('/competitions')) {
headtypes = '/competitions';
}else if (match.path.startsWith('/crowdsourcing')) {
headtypes = '/crowdsourcing';
}else if(match.path.startsWith('/moop_cases')){
headtypes = '/moop_cases';
}else {
headtypes = '/';
}
}
}else{
if (match.path === '/forums') {
headtypes = '/forums';
} else if (match.path.startsWith('/shixuns')) {
headtypes = '/shixuns';
}else if (match.path.startsWith('/paths')) {
headtypes = '/paths';
} else if (match.path.startsWith('/courses')) {
headtypes = '/courses';
}else if (match.path.startsWith('/competitions')) {
headtypes = '/competitions';
}else if (match.path.startsWith('/crowdsourcing')) {
headtypes = '/crowdsourcing';
}else if(match.path.startsWith('/moop_cases')){
headtypes = '/moop_cases';
}else {
headtypes = '/';
}
}
}else{
if (match.path === '/forums') {
headtypes = '/forums';
} else if (match.path.startsWith('/shixuns')) {
headtypes = '/shixuns';
}else if (match.path.startsWith('/paths')) {
headtypes = '/paths';
} else if (match.path.startsWith('/courses')) {
headtypes = '/courses';
}else if (match.path.startsWith('/competitions')) {
headtypes = '/competitions';
}else if (match.path.startsWith('/crowdsourcing')) {
headtypes = '/crowdsourcing';
}else if(match.path.startsWith('/moop_cases')){
headtypes = '/moop_cases';
}else {
headtypes = '/';
}
}
// console.log("NewHeadergetHelmetapi432423423423");
// console.log(mygetHelmetapi2);
// console.log("NewHeadermygetHelmetapi123123123123");
// console.log(mygetHelmetapi2);
// console.log(this.props);
return ( return (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
@ -699,9 +873,14 @@ submittojoinclass=(value)=>{
{...this.props} {...this.props}
{...this.state} {...this.state}
/>:""} />:""}
<Link to="/" className={"fl mr30 ml25 mt10"}> <a href={"/"} onClick={()=>this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}>
<img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img> {
</Link> mygetHelmetapi2===undefined||mygetHelmetapi2.nav_logo_url===null||mygetHelmetapi2.nav_logo_url===undefined?
<img alt="高校智能化教学与实训平台" className="logoimg" style={{heigth:"40px"}} src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img>
:
<img alt="高校智能化教学与实训平台" className="logoimg" style={{heigth:"40px"}} src={getImageUrl(mygetHelmetapi2.nav_logo_url)}></img>
}
</a>
<style> <style>
{ {
@ -714,10 +893,156 @@ submittojoinclass=(value)=>{
` `
} }
</style> </style>
<div className="educontents fl"> {
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} mygetHelmetapi2!==undefined&&mygetHelmetapi2.navbar!==null&&mygetHelmetapi2.navbar!==undefined&&mygetHelmetapi2.navbar.length>0?
<div className="head-nav pr" id={"head-navpre1"}>
<ul id="header-nav">
{/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/}
{/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
{
mygetHelmetapi2.navbar && mygetHelmetapi2.navbar.map((item,key)=>{
// console.log("headtypes");
// console.log(headtypes);hidden
var str=new RegExp("http");
var strbool=false;
//test方法返回值为(true或者false)
if(item.link){
if(str.test(item.link)===true){
strbool=true
}else{
strbool=false
}
}
console.log(item.hidden);
return(
<li key={key} onClick={()=>this.headtypesonClick(item.link,true)} className={`${headtypes===undefined?'pr':headtypes===item.link?'pr active':'pr'}`} style={item.hidden==false?{display: 'block'}:{display: 'none'}}>
{
strbool===true?
<a href={item.link}>{item.name}</a>
:
<Link to={item.link}>{item.name}</Link>
}
</li>
)
})
}
{/*<li className={`${activePaths === true ? 'pr active' : 'pr'}`}>*/}
{/* <Link to={this.props.Headertop===undefined?"":'/paths'}>实践课程</Link>*/}
{/*</li>*/}
{/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
{/*<li className={`${coursestype === true ? 'pr active' : 'pr'}`}>*/}
{/* /!*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*!/*/}
{/* <Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link>*/}
{/*</li>*/}
{/*<li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>*/}
{/* <Link to="/shixuns">实训项目</Link>*/}
{/* <img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}
{/* </img>*/}
{/*</li>*/}
<div className="head-nav pr"> {/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
{/*<li className="">*/}
{/* <a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a>*/}
{/* <img className="roundedRectangles"*/}
{/* src={require('./roundedRectangle.png')}*/}
{/* />*/}
{/*</li>*/}
{/*<li className={`${activeMoopCases === true ? 'pr active' : 'pr'}`}> <Link to={`/moop_cases`}>教学案例</Link></li>*/}
{/*<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>*/}
{/*<Link to={'/crowdsourcing'}>众包创新</Link>*/}
{/*</li>*/}
{/*<li className={`${activeForums === true ? 'active' : ''}`}> <Link to={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</Link></li>*/}
{/*<li*/}
{/* style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}*/}
{/*><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li>*/}
<li className="fl edu-menu-panel careershover "
style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}>
<a>职业路径</a>
<div
style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}>
<ul className="edu-menu-list edu-menu-listnew " style={{top:'60px'}}>
{this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => {
return(
<li key={key}><i className="iconfont icon-java left careersiconfont"
style={{color: '#000 important'}}
></i><a style={{width: '83%'}}
href={item.url}>{item.name}</a></li>
)
})
}
</ul>
</div>
</li>
</ul>
</div>
// :mygetHelmetapi2===undefined||mygetHelmetapi2.navbar===null||mygetHelmetapi2.navbar===undefined||mygetHelmetapi2.navbar.length===0?
// <div className="head-nav pr" id={"head-navpre2"}>
//
// <ul id="header-nav">
// {/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/}
//
// {/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
// <li className={`${activePaths === true ? 'pr active' : 'pr'}`}>
// <Link to={this.props.Headertop===undefined?"":'/paths'}>实践课程</Link>
// </li>
//
// {/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
// <li className={`${coursestype === true ? 'pr active' : 'pr'}`}>
// {/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*/}
// <Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link>
// </li>
//
// <li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>
// <Link to="/shixuns">实训项目</Link>
// {/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}
// {/*</img>*/}
// </li>
//
// <li className="fl edu-menu-panel careershover "
// style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}>
// <a>职业路径</a>
// <div
// style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}>
// <ul className="edu-menu-list edu-menu-listnew " style={{top:'60px'}}>
// {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => {
// return(
// <li key={key}><i className="iconfont icon-java left careersiconfont"
// style={{color: '#000 important'}}
// ></i><a style={{width: '83%'}}
// href={item.url}>{item.name}</a></li>
// )
// })
// }
// </ul>
// </div>
// </li>
//
// {/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
// <li className="">
// <a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a>
// {/*<img className="roundedRectangles"*/}
// {/* src={require('./roundedRectangle.png')}*/}
// {/*/>*/}
// </li>
// <li className={`${activeMoopCases === true ? 'pr active' : 'pr'}`}> <Link to={`/moop_cases`}>教学案例</Link></li>
// {/*<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>*/}
// {/*<Link to={'/crowdsourcing'}>众包创新</Link>*/}
// {/*</li>*/}
// <li className={`${activeForums === true ? 'active' : ''}`}> <Link to={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</Link></li>
// <li
// style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
// ><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li>
// </ul>
// </div>
:
<div className="head-nav pr" id={"head-navpre3"}>
<ul id="header-nav"> <ul id="header-nav">
{/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/} {/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/}
@ -735,8 +1060,8 @@ submittojoinclass=(value)=>{
<li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}> <li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>
<Link to="/shixuns">实训项目</Link> <Link to="/shixuns">实训项目</Link>
<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img"> {/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}
</img> {/*</img>*/}
</li> </li>
<li className="fl edu-menu-panel careershover " <li className="fl edu-menu-panel careershover "
@ -761,9 +1086,9 @@ submittojoinclass=(value)=>{
{/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/} {/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
<li className=""> <li className="">
<a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a> <a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a>
<img className="roundedRectangles" {/*<img className="roundedRectangles"*/}
src={require('./roundedRectangle.png')} {/* src={require('./roundedRectangle.png')}*/}
/> {/*/>*/}
</li> </li>
<li className={`${activeMoopCases === true ? 'pr active' : 'pr'}`}> <Link to={`/moop_cases`}>教学案例</Link></li> <li className={`${activeMoopCases === true ? 'pr active' : 'pr'}`}> <Link to={`/moop_cases`}>教学案例</Link></li>
{/*<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>*/} {/*<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>*/}
@ -774,10 +1099,13 @@ submittojoinclass=(value)=>{
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}} style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li> ><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li>
</ul> </ul>
</div>
}
</div>
</div>
<style> <style>
{ {

@ -7,8 +7,8 @@ import NewFooter from './NewFooter'
import SiderBar from './SiderBar' import SiderBar from './SiderBar'
import { getUrl, downloadFile } from 'educoder' import { getUrl, downloadFile } from 'educoder'
import axios from 'axios'; import axios from 'axios';
import { Spin } from 'antd' import { Spin } from 'antd';
import './TPMIndex.css' import './TPMIndex.css';
import LoginDialog from '../login/LoginDialog'; import LoginDialog from '../login/LoginDialog';
import AccountProfile from '../user/AccountProfile'; import AccountProfile from '../user/AccountProfile';
@ -83,7 +83,8 @@ export function TPMIndexHOC(WrappedComponent) {
globalLoading: false, globalLoading: false,
dataquerys:{}, dataquerys:{},
isloginCancel:undefined isloginCancel:undefined,
mygetHelmetapi:undefined,
} }
} }
@ -147,6 +148,8 @@ export function TPMIndexHOC(WrappedComponent) {
} }
componentDidMount() { componentDidMount() {
// console.log("TPMIndexHOC========");
// console.log(this.props);
window.addEventListener('keyup', this.keyupListener) window.addEventListener('keyup', this.keyupListener)
if(this.props.match.path==="/"){ if(this.props.match.path==="/"){
@ -198,6 +201,8 @@ export function TPMIndexHOC(WrappedComponent) {
axios.get(url, { axios.get(url, {
}).then((response) => { }).then((response) => {
// console.log("开始请求/get_navigation_info.json");
// console.log(response);
if(response!=undefined){ if(response!=undefined){
if(response.status===200){ if(response.status===200){
this.setState({ this.setState({
@ -207,7 +212,8 @@ export function TPMIndexHOC(WrappedComponent) {
} }
} }
}); });
///请求定制化的信息
this.getAppdata();
} }
/** /**
课堂权限相关方法暂时写这里了 ----------------------------------------START 课堂权限相关方法暂时写这里了 ----------------------------------------START
@ -277,7 +283,67 @@ export function TPMIndexHOC(WrappedComponent) {
// //
// } // }
//获取当前定制信息
//获取当前定制信息
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);
});
};
/** /**
课堂权限相关方法暂时写这里了 ----------------------------------------END 课堂权限相关方法暂时写这里了 ----------------------------------------END
*/ */
@ -535,7 +601,7 @@ export function TPMIndexHOC(WrappedComponent) {
this.setState({ globalLoading: false }) this.setState({ globalLoading: false })
} }
render() { render() {
let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state; let{Headertop,Footerdown, isRender, AccountProfiletype,mygetHelmetapi}=this.state;
const common = { const common = {
isSuperAdmin:this.isSuperAdmin, isSuperAdmin:this.isSuperAdmin,
isAdminOrCreator:this.isAdminOrCreator, isAdminOrCreator:this.isAdminOrCreator,
@ -569,7 +635,9 @@ export function TPMIndexHOC(WrappedComponent) {
yslslowCheckresults:this.yslslowCheckresults, yslslowCheckresults:this.yslslowCheckresults,
yslslowCheckresultsNo:this.yslslowCheckresultsNo, yslslowCheckresultsNo:this.yslslowCheckresultsNo,
} };
// console.log("this.props.mygetHelmetapi");
// console.log(this.props.mygetHelmetapi);
return ( return (
<div className="indexHOC"> <div className="indexHOC">
{isRender===true ? <LoginDialog {isRender===true ? <LoginDialog
@ -644,6 +712,7 @@ export function TPMIndexHOC(WrappedComponent) {
</Spin> </Spin>
<NewFooter <NewFooter
{...this.state} {...this.props}
Footerdown={Footerdown} Footerdown={Footerdown}
/> />

@ -17,7 +17,7 @@ class LoginRegisterPage extends Component {
// newMain clearfix // newMain clearfix
return ( return (
<div className=""> <div className="">
login
<LoginRegisterComponent {...this.props} {...this.state}></LoginRegisterComponent> <LoginRegisterComponent {...this.props} {...this.state}></LoginRegisterComponent>
<br></br> <br></br>
<br></br> <br></br>

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CompetitionModeSetting, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save