dev_auth
杨树林 5 years ago
parent 8de66af98f
commit 5642586feb

@ -337,7 +337,7 @@ class App extends Component {
});
initAxiosInterceptors(this.props);
this.getAppdata();
// this.getAppdata();
//
// axios.interceptors.response.use((response) => {
// // console.log("response"+response);
@ -368,6 +368,8 @@ class App extends Component {
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({

@ -94,13 +94,13 @@ export function initAxiosInterceptors(props) {
}
}
// if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止
// console.log(config);
// console.log(JSON.parse(config));
// console.log(config.url);
// console.log("被阻止了是重复请求=================================");
// 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;

@ -20,6 +20,7 @@ import {
} 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';
@ -28,7 +29,6 @@ import educodernet from '../../../src/images/login/educodernet.png';
import LoginRegisterComponent from '../user/LoginRegisterComponent';
import FindPasswordComponent from '../user/FindPasswordComponent';
import passopen from "../../images/login/passopen.png";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
//educoder登入页面
var sectionStyle = {
"height": "100%",
@ -208,7 +208,9 @@ class EducoderLogin extends Component {
}
}
export default SnackbarHOC() (TPMIndexHOC ( EducoderLogin ));
// export default EducoderLogin ;
export default TPMIndexHOC ( EducoderLogin );
// SnackbarHOC() (TPMIndexHOC ( EducoderLogin ));
// showbool === 2 ?
// <div style={{
// display: "flex",

@ -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;

@ -148,8 +148,8 @@ export function TPMIndexHOC(WrappedComponent) {
}
componentDidMount() {
// console.log("TPMIndexHOC========");
// console.log(this.props);
console.log("TPMIndexHOC========");
console.log(this.props);
window.addEventListener('keyup', this.keyupListener)
if(this.props.match.path==="/"){

Loading…
Cancel
Save