You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
110 lines
2.6 KiB
TypeScript
110 lines
2.6 KiB
TypeScript
// https://umijs.org/config/
|
|
import { defineConfig } from 'umi';
|
|
import defaultSettings from './defaultSettings';
|
|
import proxy from './proxy';
|
|
const { UMI_ENV } = process.env;
|
|
export default defineConfig({
|
|
hash: true,
|
|
antd: {},
|
|
history: { type: 'hash' },
|
|
dva: {
|
|
hmr: true,
|
|
},
|
|
locale: {
|
|
// default zh-CN
|
|
default: 'zh-CN',
|
|
// default true, when it is true, will use `navigator.language` overwrite default
|
|
antd: true,
|
|
baseNavigator: true,
|
|
},
|
|
dynamicImport: {
|
|
loading: '@/components/PageLoading/index',
|
|
},
|
|
define: {
|
|
'process.env.API_SERVER': 'http://localhost:8888',
|
|
},
|
|
targets: {
|
|
ie: 11,
|
|
},
|
|
// umi routes: https://umijs.org/docs/routing
|
|
routes: [
|
|
{
|
|
path: '/user',
|
|
component: '../layouts/UserLayout',
|
|
routes: [
|
|
{
|
|
name: 'login',
|
|
path: '/user/login',
|
|
component: './user/login',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/',
|
|
component: '../layouts/SecurityLayout',
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
component: '../layouts/BasicLayout',
|
|
authority: ['employeeQuery', 'dataQuery', 'settingSave', 'userSave'],
|
|
routes: [
|
|
{
|
|
path: '/',
|
|
redirect: '/employee',
|
|
},
|
|
{
|
|
name: '员工信息',
|
|
icon: 'idcard',
|
|
path: 'employee',
|
|
authority: ['employeeQuery'],
|
|
component: './Employee'
|
|
},
|
|
{
|
|
name: '数据统计',
|
|
icon: 'barChart',
|
|
path: 'data-statistics',
|
|
authority: ['dataQuery'],
|
|
component: './DataStatistics'
|
|
},
|
|
{
|
|
name: 'list.maintain',
|
|
icon: 'setting',
|
|
path: 'info-setting',
|
|
authority: ['settingSave'],
|
|
component: './InfoSetting'
|
|
},
|
|
{
|
|
name: '账号管理',
|
|
icon: 'idcard',
|
|
path: 'maintain',
|
|
authority: ['userSave'],
|
|
component: './UserList',
|
|
},
|
|
{
|
|
component: './404',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
component: './404',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
component: './404',
|
|
},
|
|
],
|
|
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
|
|
theme: {
|
|
// ...darkTheme,
|
|
'primary-color': defaultSettings.primaryColor,
|
|
},
|
|
// @ts-ignore
|
|
title: false,
|
|
ignoreMomentLocale: true,
|
|
proxy: proxy[UMI_ENV || 'dev'],
|
|
manifest: {
|
|
basePath: '/',
|
|
},
|
|
});
|