|
|
|
@ -77,14 +77,14 @@ class NewHeader extends Component {
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate = (prevProps) => {
|
|
|
|
|
// console.log("componentDidMount2");
|
|
|
|
|
// console.log(this.state.mygetHelmetapi2);
|
|
|
|
|
if(this.state.mygetHelmetapi2===undefined){
|
|
|
|
|
this.getAppdata();
|
|
|
|
|
}
|
|
|
|
|
// console.log(this.props.mygetHelmetapi);
|
|
|
|
|
// if(this.props.mygetHelmetapi===undefined){
|
|
|
|
|
// this.getAppdata();
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
console.log("componentDidMount1");
|
|
|
|
|
this.getAppdata();
|
|
|
|
|
// this.getAppdata();
|
|
|
|
|
window._header_componentHandler = this;
|
|
|
|
|
|
|
|
|
|
//下拉框的显示隐藏
|
|
|
|
@ -653,70 +653,70 @@ submittojoinclass=(value)=>{
|
|
|
|
|
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);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 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;
|
|
|
|
|