Merge pull request '项目详情ssr test' (#700) from Eeeros/forgeplus-react:gitlink_ssr_head into gitlink_ssr_head

1
This commit is contained in:
Eeeros 2024-04-30 17:23:33 +08:00
commit e47a33b97f
4 changed files with 31 additions and 13 deletions

View File

@ -25,6 +25,7 @@ import { initAxiosInterceptors } from './AppConfig'
import cookie from 'react-cookies';
import InfosIndex from './forge/users/Index'
import OrganizeIndex from './forge/Team/Index'
import { connect } from 'react-redux';
window.marked = marked;
const theme = createMuiTheme({
@ -170,7 +171,7 @@ class App extends Component {
mydisplay: false,
occupation: 0,
mygetHelmetapi: null,
pathType: null,
pathType: props.projectBase && props.projectBase.author && props.projectBase.author.type,
pathName: null,
}
}
@ -652,5 +653,18 @@ moment.defineLocale('zh-cn', {
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
export default SnackbarHOC()(App);
const mapStateToProps = (state) => {
const {
projectBase,
} = state.projectReducer;
return {
projectBase,
};
}
export default connect(
mapStateToProps,
)(SnackbarHOC()(App));

View File

@ -7,6 +7,7 @@ import { withRouter } from "react-router";
import { SnackbarHOC } from "educoder";
import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
import ProjectDetail from '../Main/Detail'
import '../css/index.scss';
import './Index.scss';
@ -35,10 +36,10 @@ const SubDetailIndex = Loadable({
loading: Loading,
});
// forge
const ProjectDetail = Loadable({
loader: () => import("../Main/Detail"),
loading: Loading,
});
// const ProjectDetail = Loadable({
// loader: () => import("../Main/Detail"),
// loading: Loading,
// });
const team = CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
((props)=>{
return (

View File

@ -6,15 +6,17 @@ import { withRouter } from "react-router";
import { SnackbarHOC } from "educoder";
import { CNotificationHOC } from "../../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../../modules/tpm/TPMIndexHOC";
import ProjectDetail from '../Main/Detail'
const Infos = Loadable({
loader: () => import("./Infos"),
loading: Loading,
});
// forge
const ProjectDetail = Loadable({
loader: () => import("../Main/Detail"),
loading: Loading,
});
// const ProjectDetail = Loadable({
// loader: () => import("../Main/Detail"),
// loading: Loading,
// });
class DetailTop extends Component {
constructor(props) {

View File

@ -61,12 +61,13 @@ export function TPMIndexHOC(WrappedComponent) {
window.removeEventListener('keyup', this.keyupListener)
}
componentWillMount() {
this.setState({
current_user: {}
})
if (!__SERVER__) {
this.fetchUsers();
} else {
this.setState({
current_user: {}
})
}
}