Commit 8439a5c9 authored by GuanHua's avatar GuanHua

update

parent 51bc6457
This diff is collapsed.
...@@ -3,9 +3,9 @@ import routes from './router' ...@@ -3,9 +3,9 @@ import routes from './router'
import proxy from './proxy' import proxy from './proxy'
import theme from './lingxi.theme.config' import theme from './lingxi.theme.config'
const OPEN_THEME_BUILD = false // 是否开启动态主题 const OPEN_THEME_BUILD = process.env.NODE_ENV === 'production' ? true : false // 是否开启动态主题
const config:any = { const config: any = {
title: '瓴犀开放平台', title: '瓴犀开放平台',
// layout: {}, // layout: {},
antd: {}, antd: {},
...@@ -15,7 +15,7 @@ const config:any = { ...@@ -15,7 +15,7 @@ const config:any = {
baseNavigator: true, baseNavigator: true,
}, },
nodeModulesTransform: { nodeModulesTransform: {
type: 'none', type: 'none'
}, },
routes, routes,
extraBabelPlugins: [ extraBabelPlugins: [
...@@ -40,7 +40,6 @@ const config:any = { ...@@ -40,7 +40,6 @@ const config:any = {
// 自定义修改webpack配置 // 自定义修改webpack配置
chainWebpack(memo, { env, webpack, createCSSRule }) { chainWebpack(memo, { env, webpack, createCSSRule }) {
}, },
cssLoader: { cssLoader: {
localsConvention: 'camelCase', // 将style中的class由 .foo-body 转化为fooBody调用 localsConvention: 'camelCase', // 将style中的class由 .foo-body 转化为fooBody调用
}, },
...@@ -73,10 +72,10 @@ const config:any = { ...@@ -73,10 +72,10 @@ const config:any = {
* https://umijs.org/zh-CN/config#theme * https://umijs.org/zh-CN/config#theme
* 配置主题,实际上是配 less 变量。 * 配置主题,实际上是配 less 变量。
*/ */
theme: theme theme,
} }
if(OPEN_THEME_BUILD) { if (OPEN_THEME_BUILD) {
config.plugins = [...config.plugins, 'umi-plugin-antd-theme'] config.plugins = [...config.plugins, 'umi-plugin-antd-theme']
delete config.theme delete config.theme
} }
......
{ {
"theme": [ "theme": [
{ {
"fileName": "theme1.css", "fileName": "science.css",
"key": "theme1", "key": "science",
"modifyVars": { "modifyVars": {
"@primary-color": "#00B37A", "@primary-color": "#00B37A",
"@layout-header-background": "#FFF" "@layout-header-background": "#FFF"
} }
},
{
"fileName": "fresh.css",
"key": "fresh",
"modifyVars": {
"@primary-color": "#F5222D",
"@layout-header-background": "#FFF"
}
} }
], ],
"min": true, "min": true,
"isModule": false, "isModule": true,
"ignoreAntd": false, "ignoreAntd": false,
"ignoreProLayout": false, "ignoreProLayout": false,
"cache": true "cache": true
......
...@@ -7,12 +7,12 @@ const mockData = { ...@@ -7,12 +7,12 @@ const mockData = {
countryList: [ countryList: [
{ {
name: '简体中文-ZH', name: '简体中文-ZH',
key: 'cn', key: 'zh-CN',
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png' icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/china.png'
}, },
{ {
name: 'English-EN', name: 'English-EN',
key: 'en', key: 'en-US',
icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png' icon: 'http://lingxi-frontend-test.oss-cn-hangzhou.aliyuncs.com/images/us.png'
}, },
{ {
...@@ -35,6 +35,6 @@ exports.fetchConfig = async () => { ...@@ -35,6 +35,6 @@ exports.fetchConfig = async () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
setTimeout(() => { setTimeout(() => {
resolve(mockData.data) resolve(mockData.data)
}, 2* 1000) }, 2 * 1000)
}) })
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ import { observable } from 'mobx' ...@@ -2,7 +2,7 @@ import { observable } from 'mobx'
import { IThemeModule } from '@/types/ThemeStoreType' import { IThemeModule } from '@/types/ThemeStoreType'
class ThemeStore implements IThemeModule { class ThemeStore implements IThemeModule {
@observable public themeName: string = 'theme1'; @observable public themeName: string = 'science';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment