dev_auth
杨树林 5 years ago
parent 28fbfa82cb
commit a3dc1d6adf

@ -68,7 +68,6 @@
"react-content-loader": "^3.1.1", "react-content-loader": "^3.1.1",
"react-dev-utils": "^5.0.0", "react-dev-utils": "^5.0.0",
"react-dom": "^16.9.0", "react-dom": "^16.9.0",
"react-helmet": "^5.2.1",
"react-hot-loader": "^4.0.0", "react-hot-loader": "^4.0.0",
"react-infinite-scroller": "^1.2.4", "react-infinite-scroller": "^1.2.4",
"react-loadable": "^5.3.1", "react-loadable": "^5.3.1",

@ -11,7 +11,7 @@
<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.
@ -21,7 +21,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>

@ -275,7 +275,7 @@ class App extends Component {
Addcoursestypes:false, Addcoursestypes:false,
mydisplay:false, mydisplay:false,
occupation:0, occupation:0,
getapi:undefined, getHelmetapi:undefined,
} }
} }
@ -358,22 +358,35 @@ class App extends Component {
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response){ if(response){
this.setState({ this.setState({
getapi:response.data.setting getHelmetapi: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.nav_logo_url;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
} }
}).catch((error) => { }).catch((error) => {
}); });
} };
render() { render() {
let{getHelmetapi}=this.state;
// console.log("appappapp");
// console.log(getHelmetapi);
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>

@ -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==="/"){
@ -207,7 +210,7 @@ export function TPMIndexHOC(WrappedComponent) {
} }
} }
}); });
this.getAppdata();
} }
/** /**
课堂权限相关方法暂时写这里了 ----------------------------------------START 课堂权限相关方法暂时写这里了 ----------------------------------------START
@ -277,7 +280,32 @@ export function TPMIndexHOC(WrappedComponent) {
// //
// } // }
//获取当前定制信息
getAppdata=()=>{
let url = "/setting.json";
axios.get(url).then((response) => {
if(response){
this.setState({
mygetHelmetapi:response.data.setting,
});
// console.log("获取当前定制信息");
// console.log(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.nav_logo_url;
if (oldLink) {
document.head.removeChild(oldLink);
}
document.head.appendChild(link);
}
}).catch((error) => {
});
};
/** /**
课堂权限相关方法暂时写这里了 ----------------------------------------END 课堂权限相关方法暂时写这里了 ----------------------------------------END
*/ */
@ -534,6 +562,19 @@ export function TPMIndexHOC(WrappedComponent) {
hideGlobalLoading = () => { hideGlobalLoading = () => {
this.setState({ globalLoading: false }) this.setState({ globalLoading: false })
} }
getAppdata=()=>{
let url = "/setting.json";
axios.get(url).then((response) => {
if(response){
this.setState({
getHelmetapi:response.data.setting
})
}
}).catch((error) => {
});
};
render() { render() {
let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state; let{Headertop,Footerdown, isRender, AccountProfiletype}=this.state;
const common = { const common = {
@ -569,7 +610,9 @@ export function TPMIndexHOC(WrappedComponent) {
yslslowCheckresults:this.yslslowCheckresults, yslslowCheckresults:this.yslslowCheckresults,
yslslowCheckresultsNo:this.yslslowCheckresultsNo, yslslowCheckresultsNo:this.yslslowCheckresultsNo,
} };
// console.log("this.props.getHelmetapi");
// console.log(this.props.getHelmetapi);
return ( return (
<div className="indexHOC"> <div className="indexHOC">
{isRender===true ? <LoginDialog {isRender===true ? <LoginDialog

Loading…
Cancel
Save