| | |
| | | }, |
| | | { |
| | | path: '/live', |
| | | name: '课程与学习', |
| | | name: '内容', |
| | | icon: 'read', |
| | | access: 'canViewLiveModule', |
| | | routes: [ |
| | | { |
| | | path: '/live', |
| | | redirect: '/live/course', |
| | | redirect: '/live/course/broadcast', |
| | | }, |
| | | { |
| | | path: '/live/expert', |
| | | redirect: '/live/course/expert', |
| | | }, |
| | | { |
| | | path: '/live/course', |
| | | name: '课程管理', |
| | | name: '类直播', |
| | | routes: [ |
| | | { |
| | | path: '/live/course', |
| | | redirect: '/live/course/broadcast', |
| | | }, |
| | | { |
| | | name: '养生直播', |
| | | path: '/live/course/broadcast', |
| | |
| | | component: './live/broadcast/edit', |
| | | }, |
| | | { |
| | | name: '微赞直播间设置', |
| | | path: '/live/course/live-room-setting', |
| | | access: 'live:room-setting:view', |
| | | component: './live/live-room-setting', |
| | | }, { |
| | | name: '直播预约记录', |
| | | name: '预约记录', |
| | | path: '/live/course/reserve-records', |
| | | access: 'live:reserve:view', |
| | | component: './live/reserve-records', |
| | | }, |
| | | { |
| | | name: '直播观看记录', |
| | | name: '观看记录', |
| | | path: '/live/course/watch-records', |
| | | access: 'live:watch:view', |
| | | component: './live/watch-records', |
| | | }, |
| | | { |
| | | name: '分类管理', |
| | | name: '直播预约记录跳转', |
| | | path: '/live/course/broadcast/:courseId/sessions/:sessionId/reserves', |
| | | hideInMenu: true, |
| | | access: 'live:reserve:view', |
| | | component: './live/record-redirect', |
| | | }, |
| | | { |
| | | name: '直播观看记录跳转', |
| | | path: '/live/course/broadcast/:courseId/sessions/:sessionId/watch-records', |
| | | hideInMenu: true, |
| | | access: 'live:watch:view', |
| | | component: './live/record-redirect', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: '微赞直播', |
| | | routes: [ |
| | | { |
| | | name: '直播设置', |
| | | path: '/live/course/live-room-setting', |
| | | access: 'live:room-setting:view', |
| | | component: './live/live-room-setting', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: '课程', |
| | | routes: [ |
| | | { |
| | | name: '添加分类', |
| | | path: '/live/course/category', |
| | | access: 'live:category:view', |
| | | component: './live/category', |
| | | }, |
| | | { |
| | | name: '养生课程', |
| | | name: '添加专家', |
| | | path: '/live/course/expert', |
| | | access: 'live:expert:view', |
| | | component: './live/expert', |
| | | }, |
| | | { |
| | | name: '添加课堂', |
| | | path: '/live/course/health', |
| | | access: 'live:health-course:view', |
| | | component: './live/health', |
| | | }, |
| | | { |
| | | name: '视频与课程资源管理', |
| | | name: '添加视频', |
| | | path: '/live/course/video-resources', |
| | | access: 'live:health-course:view', |
| | | component: './live/video-resources', |
| | |
| | | access: 'live:health-course:video:edit', |
| | | component: './live/health/video-manage', |
| | | }, |
| | | { |
| | | name: '直播预约记录跳转', |
| | | path: '/live/course/broadcast/:courseId/sessions/:sessionId/reserves', |
| | | hideInMenu: true, |
| | | access: 'live:reserve:view', |
| | | component: './live/record-redirect', |
| | | }, |
| | | { |
| | | name: '直播观看记录跳转', |
| | | path: '/live/course/broadcast/:courseId/sessions/:sessionId/watch-records', |
| | | hideInMenu: true, |
| | | access: 'live:watch:view', |
| | | component: './live/record-redirect', |
| | | }, |
| | | { |
| | | name: '授课专家管理', |
| | | path: '/live/course/expert', |
| | | access: 'live:expert:view', |
| | | component: './live/expert', |
| | | }, |
| | | { |
| | | path: '/live/course/project-introduction/create', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/project-introduction/create', |
| | | }, |
| | | { |
| | | path: '/live/course/project-introduction', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/project-introduction', |
| | | }, |
| | | { |
| | | path: '/live/course/project-introduction-password', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/project-introduction-password', |
| | | }, |
| | | { |
| | | path: '/live/course/health-popularization/create', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/health-popularization/create', |
| | | }, |
| | | { |
| | | path: '/live/course/health-popularization', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/health-popularization', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | path: '/live/promotion', |
| | | name: '宣传知识', |
| | | name: '科普', |
| | | routes: [ |
| | | { |
| | | path: '/live/promotion', |
| | | redirect: '/live/promotion/project-introduction', |
| | | }, |
| | | { |
| | | name: '健康知识', |
| | | path: '/live/promotion/health-popularization', |
| | |
| | | access: 'live:health-promotion:edit', |
| | | component: './live/health-promotion/manage', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | name: '项目', |
| | | routes: [ |
| | | { |
| | | name: '项目密码', |
| | | path: '/live/promotion/project-introduction-password', |
| | | access: 'live:project-introduction:view', |
| | | component: './live/project-introduction-password', |
| | | }, |
| | | { |
| | | name: '项目介绍', |
| | | path: '/live/promotion/project-introduction', |
| | |
| | | component: './live/project-introduction/manage', |
| | | }, |
| | | { |
| | | name: '项目介绍密码', |
| | | path: '/live/promotion/project-introduction-password', |
| | | access: 'live:project-introduction:view', |
| | | component: './live/project-introduction-password', |
| | | path: '/live/course/project-introduction/create', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/project-introduction/create', |
| | | }, |
| | | { |
| | | path: '/live/course/project-introduction', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/project-introduction', |
| | | }, |
| | | { |
| | | path: '/live/course/project-introduction-password', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/project-introduction-password', |
| | | }, |
| | | { |
| | | path: '/live/course/health-popularization/create', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/health-popularization/create', |
| | | }, |
| | | { |
| | | path: '/live/course/health-popularization', |
| | | hideInMenu: true, |
| | | redirect: '/live/promotion/health-popularization', |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | import type { Settings as LayoutSettings } from '@ant-design/pro-components'; |
| | | import type { MenuDataItem, Settings as LayoutSettings } from '@ant-design/pro-components'; |
| | | import { SettingDrawer } from '@ant-design/pro-components'; |
| | | import type { RunTimeLayoutConfig } from '@umijs/max'; |
| | | import { history } from '@umijs/max'; |
| | |
| | | loading?: boolean; |
| | | }; |
| | | |
| | | const ensureMenuKeys = (menuData: MenuDataItem[], parentKey = 'menu'): MenuDataItem[] => |
| | | menuData.map((item, index) => { |
| | | const key = item.key || item.path || `${parentKey}-${String(item.name || index)}`; |
| | | |
| | | return { |
| | | ...item, |
| | | key, |
| | | children: item.children ? ensureMenuKeys(item.children, String(key)) : item.children, |
| | | }; |
| | | }); |
| | | |
| | | /** |
| | | * @see https://umijs.org/zh-CN/plugins/plugin-initial-state |
| | |
| | | ); |
| | | }, |
| | | ...initialState?.settings, |
| | | menuDataRender: ensureMenuKeys, |
| | | pageTitleRender: () => '管理后台', |
| | | }; |
| | | }; |