|
|
|
@ -657,76 +657,73 @@ submittojoinclass=(value)=>{
|
|
|
|
|
headtypesonClickbool:bool,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
//获取数据为空的时候
|
|
|
|
|
gettablogourlnull =()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
mygetHelmetapi2: undefined
|
|
|
|
|
});
|
|
|
|
|
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);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//获取数据的时候
|
|
|
|
|
gettablogourldata =(response)=>{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getAppdata=()=>{
|
|
|
|
|
// console.log("开始刷新数据了")
|
|
|
|
|
let url = "/setting.json";
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
// console.log("axios.get");
|
|
|
|
|
// console.log(response);
|
|
|
|
|
|
|
|
|
|
// console.log("app.js开始请求/setting.json");
|
|
|
|
|
// console.log("获取当前定制信息");
|
|
|
|
|
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);
|
|
|
|
|
try {
|
|
|
|
|
if(response.data.setting.tab_logo_url){
|
|
|
|
|
this.gettablogourldata(response);
|
|
|
|
|
}else {
|
|
|
|
|
this.gettablogourlnull();
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
this.gettablogourlnull();
|
|
|
|
|
}
|
|
|
|
|
document.head.appendChild(link);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
this.setState({
|
|
|
|
|
mygetHelmetapi2: undefined
|
|
|
|
|
});
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
this.gettablogourlnull();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
mygetHelmetapi2: undefined
|
|
|
|
|
});
|
|
|
|
|
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);
|
|
|
|
|
this.gettablogourlnull();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log("开始刷新定制数据了但报错了");
|
|
|
|
|
console.log(error);
|
|
|
|
|
this.setState({
|
|
|
|
|
mygetHelmetapi2: undefined
|
|
|
|
|
});
|
|
|
|
|
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);
|
|
|
|
|
this.gettablogourlnull();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
render() {
|
|
|
|
@ -867,7 +864,7 @@ submittojoinclass=(value)=>{
|
|
|
|
|
|
|
|
|
|
// console.log("NewHeadergetHelmetapi432423423423");
|
|
|
|
|
// console.log(mygetHelmetapi2);
|
|
|
|
|
// console.log("NewHeadermygetHelmetapi123123123123");
|
|
|
|
|
// console.log("NewHeadermygetHelmetapi2123123123123");
|
|
|
|
|
// console.log(mygetHelmetapi2);
|
|
|
|
|
// console.log(this.props);
|
|
|
|
|
return (
|
|
|
|
|