.umirc.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import { defineConfig } from '@umijs/max';
  2. export default defineConfig({
  3. plugins: ['@plugin-web-update-notification/umijs'],
  4. antd: {},
  5. access: {},
  6. model: {},
  7. initialState: {},
  8. request: {},
  9. define: {
  10. 'process.env.NODE_ENV': process.env.NODE_ENV,
  11. 'process.env.API_HOST': process.env.API_HOST,
  12. },
  13. layout: {
  14. title: '采集设备',
  15. },
  16. base: '/',
  17. publicPath: '/',
  18. outputPath: 'collect_schedule_web',
  19. // 开发代理:将 /api 请求代理到后端服务
  20. proxy: {
  21. '/manager': {
  22. target: 'http://localhost:8080',
  23. changeOrigin: true,
  24. },
  25. '/api': {
  26. target: 'http://localhost:8080',
  27. changeOrigin: true,
  28. },
  29. },
  30. favicons: ['/assets/image/logo.ico'],
  31. hash: true,
  32. routes: [
  33. {
  34. path: '/',
  35. redirect: '/home',
  36. },
  37. {
  38. name: '首页',
  39. path: '/home',
  40. icon: 'home',
  41. component: './Home',
  42. },
  43. // 采集任务(仅查看,任务由调度引擎自动生成)
  44. {
  45. name: '采集任务',
  46. path: '/collect_task',
  47. icon: 'BookOutlined',
  48. component: './CollectionTask',
  49. },
  50. // 平台配置
  51. {
  52. name: '平台配置',
  53. path: '/platform_config',
  54. icon: 'FileTextOutlined',
  55. component: './PlatformConfig',
  56. },
  57. // 平台维护(平台注册表管理)
  58. {
  59. name: '平台维护',
  60. path: '/platform_manage',
  61. icon: 'AppstoreOutlined',
  62. component: './PlatformManage',
  63. },
  64. // 区域管理
  65. {
  66. name: '区域管理',
  67. path: '/region_manage',
  68. icon: 'EnvironmentOutlined',
  69. component: './RegionManage',
  70. },
  71. // 平台账号(仅查看和启用/禁用,账号由心跳上报自动维护)
  72. {
  73. name: '平台账号',
  74. path: '/platform_account',
  75. icon: 'UserOutlined',
  76. component: './PlatformAccount',
  77. },
  78. // 全局未匹配路由兜底到 404
  79. {
  80. path: '*',
  81. component: './404',
  82. },
  83. // 登录页
  84. {
  85. name: '登录',
  86. path: '/login',
  87. component: './Login',
  88. layout: false,
  89. },
  90. ],
  91. npmClient: 'yarn',
  92. // 网页更新提醒插件配置
  93. webUpdateNotification: {
  94. versionType: 'build_timestamp',
  95. logVersion: true,
  96. checkInterval: 0.5 * 60 * 1000,
  97. notificationConfig: {
  98. placement: 'topRight',
  99. },
  100. notificationProps: {
  101. title: '系统已更新',
  102. description: '检测到新版本,请刷新页面以获取最新功能',
  103. buttonText: '刷新',
  104. dismissButtonText: '忽略',
  105. },
  106. },
  107. });