|
|
@@ -2,6 +2,7 @@
|
|
|
import { defineConfig } from 'umi';
|
|
|
import defaultSettings from './defaultSettings';
|
|
|
import proxy from './proxy';
|
|
|
+import routes from './routes';
|
|
|
|
|
|
const { REACT_APP_ENV } = process.env;
|
|
|
|
|
|
@@ -11,6 +12,9 @@ export default defineConfig({
|
|
|
dva: {
|
|
|
hmr: true,
|
|
|
},
|
|
|
+ history: {
|
|
|
+ type: 'browser',
|
|
|
+ },
|
|
|
locale: {
|
|
|
// default zh-CN
|
|
|
default: 'zh-CN',
|
|
|
@@ -25,83 +29,17 @@ export default defineConfig({
|
|
|
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: ['admin', 'user'],
|
|
|
- routes: [
|
|
|
- {
|
|
|
- path: '/',
|
|
|
- redirect: '/welcome',
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/welcome',
|
|
|
- name: 'welcome',
|
|
|
- icon: 'smile',
|
|
|
- component: './Welcome',
|
|
|
- },
|
|
|
- {
|
|
|
- path: '/admin',
|
|
|
- name: 'admin',
|
|
|
- icon: 'crown',
|
|
|
- component: './Admin',
|
|
|
- authority: ['admin'],
|
|
|
- routes: [
|
|
|
- {
|
|
|
- path: '/admin/sub-page',
|
|
|
- name: 'sub-page',
|
|
|
- icon: 'smile',
|
|
|
- component: './Welcome',
|
|
|
- authority: ['admin'],
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- name: 'list.table-list',
|
|
|
- icon: 'table',
|
|
|
- path: '/list',
|
|
|
- component: './ListTableList',
|
|
|
- },
|
|
|
- {
|
|
|
- component: './404',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- component: './404',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- component: './404',
|
|
|
- },
|
|
|
- ],
|
|
|
+ routes,
|
|
|
// 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[REACT_APP_ENV || 'dev'],
|
|
|
manifest: {
|
|
|
basePath: '/',
|
|
|
},
|
|
|
+ exportStatic: {},
|
|
|
+ esbuild: {},
|
|
|
});
|