/**
* @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, 注意去除风格后缀和大小写,如想要配置图标为 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 则取值应为 user 或者 User
* @doc https://umijs.org/docs/guides/routes
*/
const newMenu = [
{
path: '/book',
name: "小说中心",
icon: 'icon-xiaoshuo',
routes: [
{
path: '/book',
redirect: '/book/bookManage/author',
},
{
path: '/book/bookManage/author',
name: "作者管理",
component: './book/bookManage/author',
},
{
path: '/book/bookManage/bookTags',
name: "标签管理",
component: './book/bookManage/bookTags',
},
{
path: '/book/bookManage/classifyList',
name: "分类管理",
component: './book/bookManage/classifyList',
},
{
path: '/book/bookManage/longbookList',
name: "长篇小说",
component: './book/bookManage/longbookList',
},
{
path: '/book/bookManage/shortbookList',
name: "短篇小说",
component: './book/bookManage/shortbookList',
},
],
},
{
path: '/distribution',
name: "分销中心",
routes: [
{
path: '/distribution',
redirect: '/distribution/distributor/info',
},
{
path: '/distribution/distributor/info',
name: "分销商信息",
component: './distribution/distributor/info',
},
{
path: '/distribution/miniprogram',
name: "小程序",
routes: [
{
path: '/distribution/miniprogram',
redirect: '/distribution/miniprogram/weChatInfo',
},
{
path: '/distribution/miniprogram/weChatInfo',
name: "小程序信息",
component: './distribution/miniprogram/weChatInfo',
},
{
path: '/distribution/miniprogram/mimiModule',
name: "小程序组件配置",
component: './distribution/miniprogram/mimiModule',
},
]
},
{
path: '/distribution/book',
name: "小说信息",
routes: [
{
path: '/distribution/book',
redirect: '/distribution/book//longBook',
},
{
path: '/distribution/book//longBook',
name: "长篇小说",
component: './distribution/book/longBook',
},
{
path: '/distribution/book/shortBook',
name: "短篇小说",
component: './distribution/book/shortBook',
},
]
},
{
path: '/distribution/readLog',
name: "阅读记录",
routes: [
{
path: '/distribution/readLog',
redirect: '/distribution/readLog/long',
},
{
path: '/distribution/readLog//long',
name: "长篇小说",
component: './distribution/readLog/long',
},
{
path: '/distribution/readLog/short',
name: "短篇小说",
component: './distribution/readLog/short',
},
]
},
{
path: '/distribution/orderLog',
name: "订单记录",
routes: [
{
path: '/distribution/orderLog',
redirect: '/distribution/orderLog/long',
},
{
path: '/distribution/orderLog//long',
name: "长篇小说",
component: './distribution/orderLog/long',
},
{
path: '/distribution/orderLog/short',
name: "短篇小说",
component: './distribution/orderLog/short',
},
]
},
{
path: '/distribution/payLog',
name: "消费记录",
routes: [
{
path: '/distribution/payLog',
redirect: '/distribution/payLog/long',
},
{
path: '/distribution/payLog//long',
name: "长篇小说",
component: './distribution/payLog/long',
},
{
path: '/distribution/payLog/short',
name: "短篇小说",
component: './distribution/payLog/short',
},
]
},
{
path: '/distribution/system',
name: "系统信息",
component: './distribution/system',
},
],
},
]
export default [
{
path: '/user',
layout: false,
routes: [
{
name: 'login',
path: '/user/login',
component: './User/Login',
},
],
},
{//默认进入后打开哪个页面
path: '/',
redirect: '/book',
},
{
path: '*',
layout: false,
component: './404',
},
...newMenu
];