123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- // https://umijs.org/config/
- import { defineConfig } from 'umi';
- import { join } from 'path';
- import defaultSettings from './defaultSettings';
- import proxy from './proxy';
- const { REACT_APP_ENV } = process.env;
- export default defineConfig({
- hash: true,
- antd: {},
- dva: {
- hmr: true,
- },
- layout: {
- // https://umijs.org/zh-CN/plugins/plugin-layout
- locale: true,
- siderWidth: 208,
- ...defaultSettings,
- },
- // https://umijs.org/zh-CN/plugins/plugin-locale
- 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: '@ant-design/pro-layout/es/PageLoading',
- },
- targets: {
- ie: 11,
- },
- // umi routes: https://umijs.org/docs/routing
- routes: [
- {
- path: '/user',
- layout: false,
- routes: [
- {
- path: '/user/login',
- layout: false,
- 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: '/dashboard',
- name: 'dashboard',
- icon: 'dashboard',
- routes: [
- {
- path: '/dashboard',
- redirect: '/dashboard/analysis',
- },
- {
- name: 'analysis',
- icon: 'smile',
- path: '/dashboard/analysis',
- component: './dashboard/analysis',
- },
- {
- name: 'monitor',
- icon: 'smile',
- path: '/dashboard/monitor',
- component: './dashboard/monitor',
- },
- {
- name: 'workplace',
- icon: 'smile',
- path: '/dashboard/workplace',
- component: './dashboard/workplace',
- },
- ],
- },
- {
- path: '/form',
- icon: 'form',
- name: 'form',
- routes: [
- {
- path: '/form',
- redirect: '/form/basic-form',
- },
- {
- name: 'basic-form',
- icon: 'smile',
- path: '/form/basic-form',
- component: './form/basic-form',
- },
- {
- name: 'step-form',
- icon: 'smile',
- path: '/form/step-form',
- component: './form/step-form',
- },
- {
- name: 'advanced-form',
- icon: 'smile',
- path: '/form/advanced-form',
- component: './form/advanced-form',
- },
- ],
- },
- {
- path: '/list',
- icon: 'table',
- name: 'list',
- routes: [
- {
- path: '/list/search',
- name: 'search-list',
- component: './list/search',
- routes: [
- {
- path: '/list/search',
- redirect: '/list/search/articles',
- },
- {
- name: 'articles',
- icon: 'smile',
- path: '/list/search/articles',
- component: './list/search/articles',
- },
- {
- name: 'projects',
- icon: 'smile',
- path: '/list/search/projects',
- component: './list/search/projects',
- },
- {
- name: 'applications',
- icon: 'smile',
- path: '/list/search/applications',
- component: './list/search/applications',
- },
- ],
- },
- {
- path: '/list',
- redirect: '/list/table-list',
- },
- {
- name: 'table-list',
- icon: 'smile',
- path: '/list/table-list',
- component: './list/table-list',
- },
- {
- name: 'basic-list',
- icon: 'smile',
- path: '/list/basic-list',
- component: './list/basic-list',
- },
- {
- name: 'card-list',
- icon: 'smile',
- path: '/list/card-list',
- component: './list/card-list',
- },
- ],
- },
- {
- path: '/profile',
- name: 'profile',
- icon: 'profile',
- routes: [
- {
- path: '/profile',
- redirect: '/profile/basic',
- },
- {
- name: 'basic',
- icon: 'smile',
- path: '/profile/basic',
- component: './profile/basic',
- },
- {
- name: 'advanced',
- icon: 'smile',
- path: '/profile/advanced',
- component: './profile/advanced',
- },
- ],
- },
- {
- name: 'exception',
- icon: 'warning',
- path: '/exception',
- routes: [
- {
- path: '/exception',
- redirect: '/exception/403',
- },
- {
- name: '403',
- icon: 'smile',
- path: '/exception/403',
- component: './exception/403',
- },
- {
- name: '404',
- icon: 'smile',
- path: '/exception/404',
- component: './exception/404',
- },
- {
- name: '500',
- icon: 'smile',
- path: '/exception/500',
- component: './exception/500',
- },
- ],
- },
- {
- name: 'account',
- icon: 'user',
- path: '/account',
- routes: [
- {
- path: '/account',
- redirect: '/account/center',
- },
- {
- name: 'center',
- icon: 'smile',
- path: '/account/center',
- component: './account/center',
- },
- {
- name: 'settings',
- icon: 'smile',
- path: '/account/settings',
- component: './account/settings',
- },
- ],
- },
- {
- path: '/',
- redirect: '/welcome',
- },
- {
- path: '/welcome',
- layout: false,
- component: './Welcome',
- },
- // 基础信息
- {
- path: '/basicInfo',
- name: 'basicInfo',
- component: './basicInfo/basicInfoIndex',
- routes: [
- {
- path: '/basicInfo',
- redirect: '/basicInfo/basicInfoIndex',
- },
- {
- path: '/basicInfo/carfile',
- name: 'carfile',
- component: './basicInfo/carfile',
- },
- {
- path: '/basicInfo/drivingRecord',
- name: 'drivingRecord',
- component: './basicInfo/drivingRecord',
- },
- {
- path: '/basicInfo/basicInfoIndex',
- name: 'basicInfoIndex',
- hideInMenu: true,
- component: './basicInfo/basicInfoIndex',
- },
- ],
- },
- {
- component: '404',
- },
- ],
- access: {},
- // Theme for antd: https://ant.design/docs/react/customize-theme-cn
- theme: {
- // 如果不想要 configProvide 动态设置主题需要把这个设置为 default
- // 只有设置为 variable, 才能使用 configProvide 动态设置主色调
- // https://ant.design/docs/react/customize-theme-variable-cn
- 'root-entry-name': 'variable',
- },
- // esbuild is father build tools
- // https://umijs.org/plugins/plugin-esbuild
- esbuild: {},
- title: false,
- ignoreMomentLocale: true,
- proxy: proxy[REACT_APP_ENV || 'dev'],
- manifest: {
- basePath: '/',
- },
- // Fast Refresh 热更新
- fastRefresh: {},
- openAPI: [
- {
- requestLibPath: "import { request } from 'umi'",
- // 或者使用在线的版本
- // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
- schemaPath: join(__dirname, 'oneapi.json'),
- mock: false,
- },
- {
- requestLibPath: "import { request } from 'umi'",
- schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
- projectName: 'swagger',
- },
- ],
- nodeModulesTransform: {
- type: 'none',
- },
- mfsu: {},
- webpack5: {},
- exportStatic: {},
- });
|