| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- import { defineConfig } from '@umijs/max';
- export default defineConfig({
- plugins: ['@plugin-web-update-notification/umijs'],
- antd: {},
- access: {},
- model: {},
- initialState: {},
- request: {},
- define: {
- 'process.env.NODE_ENV': process.env.NODE_ENV,
- 'process.env.API_HOST': process.env.API_HOST,
- },
- layout: {
- title: '采集设备',
- },
- base: '/',
- publicPath: '/',
- outputPath: 'collect_schedule_web',
- // 如需设置 favicon,建议将文件放在 `public/` 并用绝对路径,例如:favicons: ['/logo.ico']
- // 开发代理:将 /api 请求代理到后端服务
- proxy: {
- '/manager': {
- target: 'http://schedule.dfwy.tech',
- changeOrigin: true,
- // 如需代理 HTTPS 且后端证书非受信,可打开:
- // secure: false,
- // 如需代理 WebSocket,打开:
- // ws: true,
- },
- },
- favicons: ['/assets/image/logo.ico'],
- hash: true,
- routes: [
- {
- path: '/',
- redirect: '/home',
- },
- {
- name: '首页',
- path: '/home',
- icon: 'home',
- component: './Home',
- },
- //采集任务
- {
- name: '采集任务',
- path: '/collect_task',
- icon: 'BookOutlined',
- component: './CollectionTask',
- },
- {
- name: '设备管理',
- path: '/equipment_manager',
- icon: 'DatabaseOutlined',
- component: './EquipmentManager',
- },
- {
- name: '设备账号管理',
- path: '/equipment_account_manager',
- icon: 'ProfileOutlined',
- component: './EquipmentAcountManager',
- },
- {
- name: '平台配置',
- path: '/platform_config',
- icon: 'FileTextOutlined',
- component: './PlatformConfig',
- },
- {
- name: '设备任务分配',
- path: '/collect_task_allocate',
- icon: 'ProjectOutlined',
- component: './EquipmentTaskAllocate',
- },
- {
- name: '设备任务记录',
- path: '/collect_task_record',
- icon: 'CalendarOutlined',
- component: './EquipmentTaskRecord',
- },
- // 全局未匹配路由兜底到 404
- {
- path: '*',
- component: './404',
- },
- // 登录页
- {
- name: '登录',
- path: '/login',
- component: './Login',
- layout: false,
- },
- ],
- npmClient: 'yarn',
- // 网页更新提醒插件配置
- webUpdateNotification: {
- // 版本来源:git 提交哈希
- versionType: 'build_timestamp',
- // 控制台打印当前版本号,便于排查
- logVersion: true,
- // 轮询检测间隔(毫秒)。生产可调大一些,例如 5-10 分钟
- checkInterval: 0.5 * 60 * 1000,
- notificationConfig: {
- placement: 'topRight',
- },
- // 通知栏文案(中文)
- notificationProps: {
- title: '系统已更新',
- description: '检测到新版本,请刷新页面以获取最新功能',
- buttonText: '刷新',
- dismissButtonText: '忽略',
- },
- },
- });
|