292 lines
6.9 KiB
TypeScript
292 lines
6.9 KiB
TypeScript
/**
|
||
* @name umi 的路由配置
|
||
* @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
|
||
* @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
|
||
* @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
|
||
* @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。
|
||
* @param redirect 配置路由跳转
|
||
* @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验
|
||
* @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题
|
||
* @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
|
||
* @doc https://umijs.org/docs/guides/routes
|
||
*/
|
||
export default [
|
||
{
|
||
path: '/dashboard',
|
||
name: '首页',
|
||
icon: 'Home',
|
||
component: './dashboard/workplace',
|
||
},
|
||
{
|
||
path: '/news',
|
||
name: '动态',
|
||
icon: 'FileText',
|
||
routes: [
|
||
{
|
||
path: '/news',
|
||
redirect: '/news/list',
|
||
},
|
||
{
|
||
name: '动态列表',
|
||
path: '/news/list',
|
||
component: './news/list',
|
||
},
|
||
],
|
||
},
|
||
|
||
{
|
||
path: '/banner',
|
||
name: 'banner',
|
||
icon: 'FileText',
|
||
routes: [
|
||
{
|
||
path: '/banner',
|
||
redirect: '/banner/list',
|
||
},
|
||
{
|
||
name: 'banner列表',
|
||
path: '/banner/list',
|
||
component: './banner/list',
|
||
},
|
||
],
|
||
},
|
||
|
||
// {
|
||
// path: '/coupon',
|
||
// name: '优惠券',
|
||
// icon: 'FileText',
|
||
// 'access': 'canAdmin',
|
||
// routes: [
|
||
// {
|
||
// path: '/coupon',
|
||
// redirect: '/coupon/list',
|
||
// },
|
||
// {
|
||
// name: '券类型',
|
||
// path: '/coupon/list',
|
||
// component: './coupon/list',
|
||
// },
|
||
// ],
|
||
// },
|
||
|
||
{
|
||
path: '/member',
|
||
name: '用户',
|
||
icon: 'FileText',
|
||
'access': 'canAdmin',
|
||
routes: [
|
||
{
|
||
path: '/member',
|
||
redirect: '/member/list',
|
||
},
|
||
{
|
||
name: '用户列表',
|
||
path: '/member/list',
|
||
component: './member/list',
|
||
},
|
||
],
|
||
},
|
||
// {
|
||
// path: '/ground_place',
|
||
// name: '用户',
|
||
// icon: 'FileText',
|
||
// routes: [
|
||
// {
|
||
// path: '/ground_place',
|
||
// redirect: '/ground_place/list',
|
||
// },
|
||
// {
|
||
// name: '用户列表',
|
||
// path: '/ground_place/list',
|
||
// component: './ground_place/list',
|
||
// },
|
||
// ],
|
||
// },
|
||
{
|
||
path: '/order',
|
||
name: '订单管理',
|
||
icon: 'FileText',
|
||
'access': 'canAdmin',
|
||
routes: [
|
||
{
|
||
path: '/order',
|
||
redirect: '/order/list',
|
||
},
|
||
{
|
||
name: '订单列表',
|
||
path: '/order/list',
|
||
component: './order/list',
|
||
'access': 'canAdmin',
|
||
},
|
||
],
|
||
},
|
||
// {
|
||
// path: '/groupact',
|
||
// name: '畅打活动',
|
||
// icon: 'FileText',
|
||
// routes: [
|
||
// {
|
||
// path: '/groupact',
|
||
// redirect: '/groupact/list',
|
||
// },
|
||
// {
|
||
// name: '活动列表',
|
||
// path: '/groupact/list',
|
||
// component: './groupact/list',
|
||
// },
|
||
// ],
|
||
// },
|
||
// {
|
||
// path: '/match',
|
||
// name: '赛事',
|
||
// icon: 'FileText',
|
||
// routes: [
|
||
// {
|
||
// path: '/match',
|
||
// redirect: '/match/list',
|
||
// },
|
||
// {
|
||
// name: '赛事列表',
|
||
// path: '/match/list',
|
||
// component: './match/list',
|
||
// },
|
||
// ],
|
||
// },
|
||
// {
|
||
// path: '/ground',
|
||
// name: '场馆管理',
|
||
// icon: 'FileText',
|
||
// routes: [
|
||
// {
|
||
// path: '/ground',
|
||
// redirect: '/ground/list',
|
||
// },
|
||
// {
|
||
// name: '场馆列表',
|
||
// path: '/ground/list',
|
||
// component: './ground/list',
|
||
// },
|
||
// {
|
||
// name: '场地列表',
|
||
// path: '/ground/place/list/:ground_id',
|
||
// component: './ground_place/list',
|
||
// hideInMenu: true,
|
||
// },
|
||
// {
|
||
// name: '场馆预定情况',
|
||
// path: '/ground/dashboard/:ground_id',
|
||
// component: './ground/dashboard',
|
||
// hideInMenu: true,
|
||
// },
|
||
// ],
|
||
// },
|
||
// {
|
||
// path: '/classes',
|
||
// name: '课程管理',
|
||
// icon: 'FileText',
|
||
// 'access': 'canAdmin',
|
||
// routes: [
|
||
// {
|
||
// path: '/classes',
|
||
// redirect: '/classes/list',
|
||
// },
|
||
// {
|
||
// name: '课程列表',
|
||
// path: '/classes/list',
|
||
// component: './classes/list',
|
||
// },
|
||
// ],
|
||
// },
|
||
// {
|
||
// path: '/teacher',
|
||
// name: '教练管理',
|
||
// icon: 'FileText',
|
||
// 'access': 'canAdmin',
|
||
// routes: [
|
||
// {
|
||
// path: '/teacher',
|
||
// redirect: '/teacher/list',
|
||
// },
|
||
// {
|
||
// name: '教练列表',
|
||
// path: '/teacher/list',
|
||
// component: './teacher/list',
|
||
// },
|
||
// ],
|
||
// },
|
||
{
|
||
path: '/setting',
|
||
name: '设置',
|
||
icon: 'Setting',
|
||
routes: [
|
||
{
|
||
path: '/setting',
|
||
redirect: '/setting/user/list',
|
||
},
|
||
{
|
||
name: '权限管理',
|
||
path: '/setting/user/list',
|
||
component: './setting/user/list',
|
||
'access': 'canAdmin',
|
||
},
|
||
// {
|
||
// name: '会员等级',
|
||
// path: '/setting/viplevel/list',
|
||
// component: './setting/viplevel/list',
|
||
// 'access': 'canAdmin',
|
||
// },
|
||
// {
|
||
// name: '短信匹配管理',
|
||
// path: '/setting/sms_match/list',
|
||
// component: './setting/sms_match/list',
|
||
// 'access': 'canAdmin',
|
||
// },
|
||
{
|
||
name: '基础配置',
|
||
path: '/setting/config/list',
|
||
component: './setting/config/list',
|
||
// 'access': 'canAdmin',
|
||
},
|
||
],
|
||
},
|
||
// {
|
||
// path: '/m',
|
||
// layout: false,
|
||
// routes: [
|
||
// {
|
||
// path: '/m/shenpi/list',
|
||
// layout: false,
|
||
// name: 'm_shenpi_list',
|
||
// component: './shenpi/mlist',
|
||
// },
|
||
// ],
|
||
// },
|
||
{
|
||
path: '/user',
|
||
layout: false,
|
||
routes: [
|
||
{
|
||
path: '/user/login',
|
||
layout: false,
|
||
name: 'login',
|
||
component: './user/login',
|
||
},
|
||
{
|
||
path: '/user',
|
||
redirect: '/user/login',
|
||
},
|
||
// {
|
||
// component: '404',
|
||
// path: '/*',
|
||
// },
|
||
],
|
||
},
|
||
{
|
||
path: '/',
|
||
component: './root',
|
||
},
|
||
{
|
||
component: '404',
|
||
path: '/*',
|
||
},
|
||
];
|