.umirc.ts 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. // 如需设置 favicon,建议将文件放在 `public/` 并用绝对路径,例如:favicons: ['/logo.ico']
  20. // 开发代理:将 /api 请求代理到后端服务
  21. proxy: {
  22. '/manager': {
  23. target: 'http://schedule.dfwy.tech',
  24. changeOrigin: true,
  25. // 如需代理 HTTPS 且后端证书非受信,可打开:
  26. // secure: false,
  27. // 如需代理 WebSocket,打开:
  28. // ws: true,
  29. },
  30. },
  31. favicons: ['/assets/image/logo.ico'],
  32. hash: true,
  33. routes: [
  34. {
  35. path: '/',
  36. redirect: '/home',
  37. },
  38. {
  39. name: '首页',
  40. path: '/home',
  41. icon: 'home',
  42. component: './Home',
  43. },
  44. //采集任务
  45. {
  46. name: '采集任务',
  47. path: '/collect_task',
  48. icon: 'BookOutlined',
  49. component: './CollectionTask',
  50. },
  51. {
  52. name: '设备管理',
  53. path: '/equipment_manager',
  54. icon: 'DatabaseOutlined',
  55. component: './EquipmentManager',
  56. },
  57. {
  58. name: '设备账号管理',
  59. path: '/equipment_account_manager',
  60. icon: 'ProfileOutlined',
  61. component: './EquipmentAcountManager',
  62. },
  63. {
  64. name: '平台配置',
  65. path: '/platform_config',
  66. icon: 'FileTextOutlined',
  67. component: './PlatformConfig',
  68. },
  69. {
  70. name: '设备任务分配',
  71. path: '/collect_task_allocate',
  72. icon: 'ProjectOutlined',
  73. component: './EquipmentTaskAllocate',
  74. },
  75. {
  76. name: '设备任务记录',
  77. path: '/collect_task_record',
  78. icon: 'CalendarOutlined',
  79. component: './EquipmentTaskRecord',
  80. },
  81. // 全局未匹配路由兜底到 404
  82. {
  83. path: '*',
  84. component: './404',
  85. },
  86. // 登录页
  87. {
  88. name: '登录',
  89. path: '/login',
  90. component: './Login',
  91. layout: false,
  92. },
  93. ],
  94. npmClient: 'yarn',
  95. // 网页更新提醒插件配置
  96. webUpdateNotification: {
  97. // 版本来源:git 提交哈希
  98. versionType: 'build_timestamp',
  99. // 控制台打印当前版本号,便于排查
  100. logVersion: true,
  101. // 轮询检测间隔(毫秒)。生产可调大一些,例如 5-10 分钟
  102. checkInterval: 0.5 * 60 * 1000,
  103. notificationConfig: {
  104. placement: 'topRight',
  105. },
  106. // 通知栏文案(中文)
  107. notificationProps: {
  108. title: '系统已更新',
  109. description: '检测到新版本,请刷新页面以获取最新功能',
  110. buttonText: '刷新',
  111. dismissButtonText: '忽略',
  112. },
  113. },
  114. });