This commit is contained in:
caishi 2020-06-12 16:14:11 +08:00
parent 6f301024b4
commit d0828c3c7b
2 changed files with 4 additions and 12 deletions

View File

@ -20,7 +20,6 @@ import Loading from './Loading'
import Loadable from 'react-loadable';
import marked from './common/marked';
import cookies from 'react-cookies';
import moment from 'moment'
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
@ -75,7 +74,6 @@ const OrganizeIndex = Loadable({
class App extends Component {
constructor(props) {
console.log("cook ",cookies.load("autologin_trustie"));
super(props);
this.state = {
Addcoursestype: false,
@ -85,6 +83,7 @@ class App extends Component {
mygetHelmetapi: null,
}
}
HideAddcoursestypess = (i) => {
this.setState({
Addcoursestype: false,

View File

@ -8,13 +8,13 @@ import './TPMIndex.css';
import LoginDialog from '../login/LoginDialog';
import AccountProfile from '../user/AccountProfile';
import AccountPhoneemail from '../user/AccountPhoneemail';
const $ = window.$;
import cookies from 'react-cookies';
export function TPMIndexHOC(WrappedComponent) {
// 这里如果extends WrappedComponent 会出现 WrappedComponent mount twice的问题
return class II extends React.Component {
constructor(props) {
super(props)
console.log("cook ",cookies.load("autologin_trustie"));
super(props);
window.$('#root').css('position', 'relative')
this.state = {
@ -165,13 +165,6 @@ export function TPMIndexHOC(WrappedComponent) {
this.setState({
tpmLoading: false
})
if(response.data.login){
const { pathname } = this.props.history.location;
console.log("pathname ",pathname);
if(pathname ==="/"){
this.props.history.push(`/users/${response.data.login}`);
}
}
}
}).catch((error) => {
console.log(error)