forked from Gitlink/build
test
This commit is contained in:
parent
6f301024b4
commit
d0828c3c7b
|
@ -20,7 +20,6 @@ import Loading from './Loading'
|
||||||
|
|
||||||
import Loadable from 'react-loadable';
|
import Loadable from 'react-loadable';
|
||||||
import marked from './common/marked';
|
import marked from './common/marked';
|
||||||
import cookies from 'react-cookies';
|
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
|
|
||||||
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
|
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
|
||||||
|
@ -75,7 +74,6 @@ const OrganizeIndex = Loadable({
|
||||||
|
|
||||||
class App extends Component {
|
class App extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
console.log("cook ",cookies.load("autologin_trustie"));
|
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
Addcoursestype: false,
|
Addcoursestype: false,
|
||||||
|
@ -85,6 +83,7 @@ class App extends Component {
|
||||||
mygetHelmetapi: null,
|
mygetHelmetapi: null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HideAddcoursestypess = (i) => {
|
HideAddcoursestypess = (i) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
Addcoursestype: false,
|
Addcoursestype: false,
|
||||||
|
|
|
@ -8,13 +8,13 @@ import './TPMIndex.css';
|
||||||
import LoginDialog from '../login/LoginDialog';
|
import LoginDialog from '../login/LoginDialog';
|
||||||
import AccountProfile from '../user/AccountProfile';
|
import AccountProfile from '../user/AccountProfile';
|
||||||
import AccountPhoneemail from '../user/AccountPhoneemail';
|
import AccountPhoneemail from '../user/AccountPhoneemail';
|
||||||
const $ = window.$;
|
import cookies from 'react-cookies';
|
||||||
|
|
||||||
export function TPMIndexHOC(WrappedComponent) {
|
export function TPMIndexHOC(WrappedComponent) {
|
||||||
// 这里如果extends WrappedComponent 会出现 WrappedComponent mount twice的问题
|
|
||||||
return class II extends React.Component {
|
return class II extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
console.log("cook ",cookies.load("autologin_trustie"));
|
||||||
|
super(props);
|
||||||
window.$('#root').css('position', 'relative')
|
window.$('#root').css('position', 'relative')
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
@ -165,13 +165,6 @@ export function TPMIndexHOC(WrappedComponent) {
|
||||||
this.setState({
|
this.setState({
|
||||||
tpmLoading: false
|
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) => {
|
}).catch((error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
Loading…
Reference in New Issue