11import React from 'react'
22import { Provider } from 'mobx-react'
33
4- import GAWraper from '../../ components/GAWraper'
5- import initRootStore from '../../ stores/init'
6- import ThemeWrapper from '../../ containers/ThemeWrapper'
7- import MultiLanguage from '../../ containers/MultiLanguage'
8- import Sidebar from '../../ containers/Sidebar'
9- import Preview from '../../ containers/Preview'
10- import Doraemon from '../../ containers/Doraemon'
11- import Route from '../../ containers/Route'
12- import BodyLayout from '../../ containers/BodyLayout'
13- import Header from '../../ containers/Header'
14- import CommunitiesBanner from '../../ containers/CommunitiesBanner'
15- import CommunitiesContent from '../../ containers/CommunitiesContent'
4+ import GAWraper from '../components/GAWraper'
5+ import initRootStore from '../stores/init'
6+ import ThemeWrapper from '../containers/ThemeWrapper'
7+ import MultiLanguage from '../containers/MultiLanguage'
8+ import Sidebar from '../containers/Sidebar'
9+ import Preview from '../containers/Preview'
10+ import Doraemon from '../containers/Doraemon'
11+ import Route from '../containers/Route'
12+ import BodyLayout from '../containers/BodyLayout'
13+ import Header from '../containers/Header'
14+ import CommunitiesBanner from '../containers/CommunitiesBanner'
15+ import CommunitiesContent from '../containers/CommunitiesContent'
1616
17- import { P } from '../../ containers/schemas'
17+ import { P } from '../containers/schemas'
1818
1919import {
2020 makeGQClient ,
2121 // Global,
2222 // queryStringToJSON,
2323 /* mergeRouteQuery */
24- // getSubPath,
24+ getMainPath ,
25+ getSubPath ,
2526 BStore ,
26- } from '../../ utils'
27- import Footer from '../../ components/Footer'
27+ } from '../utils'
28+ import Footer from '../components/Footer'
2829
2930// try to fix safari bug
3031// see https://github.com/yahoo/react-intl/issues/422
@@ -41,6 +42,9 @@ async function fetchData(props) {
4142 const token = BStore . cookie . from_req ( props . req , 'jwtToken' )
4243 const gqClient = makeGQClient ( token )
4344
45+ const subpath = getSubPath ( props )
46+ console . log ( 'subpath --> ' , subpath )
47+
4448 const pagedCommunities = gqClient . request ( P . pagedCommunities , {
4549 filter : { page : 1 , size : 30 } ,
4650 } )
@@ -57,16 +61,15 @@ export default class Index extends React.Component {
5761 // if (!isServer) return {}
5862
5963 console . log ( '## communities ## index page ..' )
64+ const subPath = getSubPath ( props )
65+ const mainPath = getMainPath ( props )
6066
6167 const { pagedCommunities } = await fetchData ( props )
6268
6369 return {
64- // version: store.version,
65- // messages,
66- // locale,
70+ route : { mainPath, subPath } ,
6771 communities : pagedCommunities ,
6872 communitiesContent : { pagedCommunities } ,
69- communitiesBanner : { totalCount : pagedCommunities . totalCount } ,
7073 }
7174 }
7275
0 commit comments