Merge branch 'develop' of https://github.com/zuiidea/antd-admin into develop

This commit is contained in:
zuiidea
2019-07-06 09:43:30 +08:00
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -5,12 +5,14 @@ import { I18nProvider } from '@lingui/react'
import { langFromPath, defaultLanguage } from 'utils'
import zh_CN from 'antd/lib/locale-provider/zh_CN'
import en_US from 'antd/lib/locale-provider/en_US'
import pt_BR from 'antd/lib/locale-provider/pt_BR'
import BaseLayout from './BaseLayout'
const languages = {
zh: zh_CN,
en: en_US,
'pt-br': pt_BR,
}
@withRouter
+3
View File
@@ -2,6 +2,8 @@ import { cloneDeep, isString, flow, curry } from 'lodash'
import umiRouter from 'umi/router'
import pathToRegexp from 'path-to-regexp'
import { i18n } from './config'
import moment from 'moment'
import 'moment/locale/zh-cn'
export classnames from 'classnames'
export config from './config'
@@ -245,6 +247,7 @@ export function getLocale() {
export function setLocale(language) {
if (getLocale() !== language) {
moment.locale(language === 'zh' ? 'zh-cn' : language)
umiRouter.push({
pathname: `/${language}${deLangPrefix(window.location.pathname)}`,
search: window.location.search,