123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- // https://umijs.org/config/
- import { defineConfig } from 'umi';
- import defaultSettings from './defaultSettings';
- import proxy from './proxy';
- const { REACT_APP_ENV } = process.env;
- export default defineConfig({
- hash: true,
- antd: {},
- dva: {
- hmr: true,
- },
- history: {
- type: 'browser',
- },
- locale: {
- // default zh-CN
- default: 'zh-CN',
- antd: true,
- // default true, when it is true, will use `navigator.language` overwrite default
- baseNavigator: true,
- },
- dynamicImport: {
- loading: '@/components/PageLoading/index',
- },
- targets: {
- ie: 11,
- },
- // umi routes: https://umijs.org/docs/routing
- routes: [
- {
- path: '/',
- component: '../layouts/BlankLayout',
- routes: [
- {
- path: '/user',
- component: '../layouts/UserLayout',
- routes: [
- {
- path: '/user/login',
- name: 'login',
- component: './User/login',
- },
- {
- path: '/user',
- redirect: '/user/login',
- },
- {
- name: 'register-result',
- icon: 'smile',
- path: '/user/register-result',
- component: './User/register-result',
- },
- {
- name: 'register',
- icon: 'smile',
- path: '/user/register',
- component: './User/register',
- },
- {
- component: '404',
- },
- ],
- },
- {
- path: '/',
- component: '../layouts/BasicLayout',
- Routes: ['src/pages/Authorized'],
- authority: ['admin', 'user'],
- routes: [
- {
- path: '/',
- redirect: '/dashboard/analysis',
- },
- {
- path: '/edit',
- name: 'edit',
- icon: 'edit',
- component: './edit',
- },
- {
- path: '/bugs',
- name: 'bugs',
- icon: 'BugOutlined',
- component: './bugs',
- },
- ],
- },
- ],
- },
- ],
- // Theme for antd: https://ant.design/docs/react/customize-theme-cn
- theme: {
- 'primary-color': defaultSettings.primaryColor,
- },
- title: false,
- ignoreMomentLocale: true,
- proxy: proxy[REACT_APP_ENV || 'dev'],
- manifest: {
- basePath: '/',
- },
- esbuild: {},
- });
|