-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add zh_CN
- Loading branch information
Showing
8 changed files
with
47 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,26 @@ | ||
import BasicLayout from './BasicLayout'; | ||
import BasicLayout from "./BasicLayout"; | ||
import { config } from "utils"; | ||
import { getRouterData } from 'common/router'; | ||
const { openPages } = config; | ||
export default (props) => { | ||
const { children ,location} = props; | ||
import { getRouterData } from "common/router"; | ||
import { LocaleProvider } from "antd"; | ||
import zh_CN from "antd/lib/locale-provider/zh_CN"; | ||
import "moment/locale/zh-cn"; | ||
|
||
const { openPages } = config; | ||
export default props => { | ||
const { children, location } = props; | ||
const routerData = getRouterData({}); | ||
const newProps = { | ||
...props, | ||
routerData:routerData | ||
} | ||
routerData: routerData | ||
}; | ||
let { pathname } = location; | ||
pathname = pathname.startsWith("/") ? pathname : `/${pathname}`; | ||
if (openPages && openPages.includes(pathname)) { | ||
return ( | ||
<div style={{height:'100%'}}> | ||
{children} | ||
</div> | ||
); | ||
return <div style={{ height: "100%" }}>{children}</div>; | ||
} | ||
return (<BasicLayout {...newProps}/> | ||
return ( | ||
<LocaleProvider locale={zh_CN}> | ||
<BasicLayout {...newProps} /> | ||
</LocaleProvider> | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters