|
|
@ -68,7 +68,6 @@ class NewHeader extends Component {
|
|
|
|
mydisplay:false,
|
|
|
|
mydisplay:false,
|
|
|
|
headtypesonClickbool:false,
|
|
|
|
headtypesonClickbool:false,
|
|
|
|
headtypess:"/",
|
|
|
|
headtypess:"/",
|
|
|
|
mygetHelmetapi2:undefined,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log("176")
|
|
|
|
console.log("176")
|
|
|
|
// console.log(props);
|
|
|
|
// console.log(props);
|
|
|
@ -84,7 +83,7 @@ class NewHeader extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
console.log("componentDidMount1");
|
|
|
|
console.log("componentDidMount1");
|
|
|
|
// this.getAppdata();
|
|
|
|
this.getAppdata();
|
|
|
|
window._header_componentHandler = this;
|
|
|
|
window._header_componentHandler = this;
|
|
|
|
|
|
|
|
|
|
|
|
//下拉框的显示隐藏
|
|
|
|
//下拉框的显示隐藏
|
|
|
@ -653,70 +652,6 @@ submittojoinclass=(value)=>{
|
|
|
|
headtypesonClickbool:bool,
|
|
|
|
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;
|
|
|
@ -739,7 +674,6 @@ submittojoinclass=(value)=>{
|
|
|
|
showSearchOpentype,
|
|
|
|
showSearchOpentype,
|
|
|
|
headtypesonClickbool,
|
|
|
|
headtypesonClickbool,
|
|
|
|
headtypess,
|
|
|
|
headtypess,
|
|
|
|
mygetHelmetapi2,
|
|
|
|
|
|
|
|
}=this.state;
|
|
|
|
}=this.state;
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
用户名称 用户头像url
|
|
|
|
用户名称 用户头像url
|
|
|
@ -771,12 +705,12 @@ submittojoinclass=(value)=>{
|
|
|
|
|
|
|
|
|
|
|
|
let headtypes='/';
|
|
|
|
let headtypes='/';
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("mygetHelmetapi2");
|
|
|
|
// console.log("this.props.mygetHelmetapi");
|
|
|
|
// console.log(mygetHelmetapi2);
|
|
|
|
// console.log(this.props.mygetHelmetapi);
|
|
|
|
if(mygetHelmetapi2){
|
|
|
|
if(this.props.mygetHelmetapi){
|
|
|
|
if(mygetHelmetapi2.navbar){
|
|
|
|
if(this.props.mygetHelmetapi.navbar){
|
|
|
|
if(mygetHelmetapi2.navbar.length>0){
|
|
|
|
if(this.props.mygetHelmetapi.navbar.length>0){
|
|
|
|
// console.log("mygetHelmetapi2.navbar.length>0====-=-=--=-=-=-=");
|
|
|
|
// console.log("this.props.mygetHelmetapi.navbar.length>0====-=-=--=-=-=-=");
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// console.log(match.path);
|
|
|
|
// console.log(match.path);
|
|
|
|
if(match.path==='/'){
|
|
|
|
if(match.path==='/'){
|
|
|
@ -787,9 +721,9 @@ submittojoinclass=(value)=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
for(var i=0;i<mygetHelmetapi2.navbar.length;i++){
|
|
|
|
for(var i=0;i<this.props.mygetHelmetapi.navbar.length;i++){
|
|
|
|
if(match.path===mygetHelmetapi2.navbar[i].link){
|
|
|
|
if(match.path===this.props.mygetHelmetapi.navbar[i].link){
|
|
|
|
headtypes=mygetHelmetapi2.navbar[i].link;
|
|
|
|
headtypes=this.props.mygetHelmetapi.navbar[i].link;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -854,9 +788,9 @@ submittojoinclass=(value)=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("NewHeadergetHelmetapi432423423423");
|
|
|
|
// console.log("NewHeadergetHelmetapi432423423423");
|
|
|
|
// console.log(mygetHelmetapi2);
|
|
|
|
// console.log(this.props.mygetHelmetapi);
|
|
|
|
// console.log("NewHeadermygetHelmetapi123123123123");
|
|
|
|
// console.log("NewHeadermygetHelmetapi123123123123");
|
|
|
|
// console.log(mygetHelmetapi2);
|
|
|
|
// console.log(this.props.mygetHelmetapi);
|
|
|
|
// console.log(this.props);
|
|
|
|
// console.log(this.props);
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
|
|
|
|
|
|
|
@ -875,10 +809,10 @@ submittojoinclass=(value)=>{
|
|
|
|
/>:""}
|
|
|
|
/>:""}
|
|
|
|
<a href={"/"} onClick={()=>this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}>
|
|
|
|
<a href={"/"} onClick={()=>this.headtypesonClick("/",false)} className={"fl mr30 ml25 mt10"}>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mygetHelmetapi2===undefined||mygetHelmetapi2.nav_logo_url===null||mygetHelmetapi2.nav_logo_url===undefined?
|
|
|
|
this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.nav_logo_url===null||this.props.mygetHelmetapi.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("images/educoder/headNavLogo.png?1526520218")}></img>
|
|
|
|
:
|
|
|
|
:
|
|
|
|
<img alt="高校智能化教学与实训平台" className="logoimg" style={{heigth:"40px"}} src={getImageUrl(mygetHelmetapi2.nav_logo_url)}></img>
|
|
|
|
<img alt="高校智能化教学与实训平台" className="logoimg" style={{heigth:"40px"}} src={getImageUrl(this.props.mygetHelmetapi.nav_logo_url)}></img>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
|
@ -894,13 +828,13 @@ submittojoinclass=(value)=>{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mygetHelmetapi2!==undefined&&mygetHelmetapi2.navbar!==null&&mygetHelmetapi2.navbar!==undefined&&mygetHelmetapi2.navbar.length>0?
|
|
|
|
this.props.mygetHelmetapi!==undefined&&this.props.mygetHelmetapi.navbar!==null&&this.props.mygetHelmetapi.navbar!==undefined&&this.props.mygetHelmetapi.navbar.length>0?
|
|
|
|
<div className="head-nav pr" id={"head-navpre1"}>
|
|
|
|
<div className="head-nav pr" id={"head-navpre1"}>
|
|
|
|
<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>*/}
|
|
|
|
{/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
|
|
|
|
{/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mygetHelmetapi2.navbar && mygetHelmetapi2.navbar.map((item,key)=>{
|
|
|
|
this.props.mygetHelmetapi.navbar && this.props.mygetHelmetapi.navbar.map((item,key)=>{
|
|
|
|
// console.log("headtypes");
|
|
|
|
// console.log("headtypes");
|
|
|
|
// console.log(headtypes);
|
|
|
|
// console.log(headtypes);
|
|
|
|
return(
|
|
|
|
return(
|
|
|
@ -966,7 +900,7 @@ submittojoinclass=(value)=>{
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
// :mygetHelmetapi2===undefined||mygetHelmetapi2.navbar===null||mygetHelmetapi2.navbar===undefined||mygetHelmetapi2.navbar.length===0?
|
|
|
|
// :this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.navbar===null||this.props.mygetHelmetapi.navbar===undefined||this.props.mygetHelmetapi.navbar.length===0?
|
|
|
|
// <div className="head-nav pr" id={"head-navpre2"}>
|
|
|
|
// <div className="head-nav pr" id={"head-navpre2"}>
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// <ul id="header-nav">
|
|
|
|
// <ul id="header-nav">
|
|
|
|