routes.tsx 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /**
  2. * @name umi 的路由配置
  3. * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
  4. * @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
  5. * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
  6. * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。
  7. * @param redirect 配置路由跳转
  8. * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验
  9. * @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题
  10. * @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
  11. * @doc https://umijs.org/docs/guides/routes
  12. */
  13. const newMenu = [
  14. // 分销商页面
  15. {
  16. path: '/distributor',
  17. redirect: '/distributor/account',
  18. },
  19. {
  20. name: 'distributor.account',
  21. icon: 'icon-zhanghaoguanli',
  22. path: '/distributor/account',
  23. access: "isShow",
  24. component: './Distributor/Account',
  25. },
  26. {
  27. name: 'distributor.appManage',
  28. icon: 'icon-yingyongguanliyuanguanli',
  29. path: '/distributor/appManage',
  30. access: "isShow",
  31. component: './Distributor/AppManage',
  32. },
  33. {
  34. name: 'distributor.appList',
  35. icon: 'icon-yingyongguanli',
  36. path: '/distributor/appList',
  37. access: "isShow",
  38. component: './Distributor/AppList',
  39. },
  40. {
  41. name: 'distributor.corpManage',
  42. icon: 'icon-qiwei_qiwei',
  43. path: '/distributor/corpManage',
  44. access: "isShow",
  45. component: './Distributor/CorpManage',
  46. },
  47. // {
  48. // name: 'distributor.wxMiniApp',
  49. // icon: 'icon-weixin',
  50. // path: '/distributor/wxMiniApp',
  51. // access: "isShow",
  52. // component: './Distributor/WxMiniApp',
  53. // },
  54. // {
  55. // name: 'distributor.dyMiniApp',
  56. // icon: 'icon-douyinzhanghao',
  57. // path: '/distributor/dyMiniApp',
  58. // access: "isShow",
  59. // component: './Distributor/DyMiniApp',
  60. // },
  61. // 小程序页面
  62. {
  63. path: '/miniApp',
  64. redirect: '/miniApp/book',
  65. },
  66. // 用户管理
  67. {
  68. path: '/miniApp/user',
  69. name: 'miniApp.user',
  70. icon: 'icon-zhanghaoguanli-wx',
  71. access: 'isShow',
  72. component: './MiniApp/MiniAppUser',
  73. },
  74. // 小说管理
  75. {
  76. path: '/miniApp/book',
  77. name: 'miniApp.book',
  78. icon: 'icon-xiaoshuo-wx',
  79. access: 'isShow',
  80. component: './MiniApp/BookManage',
  81. },
  82. // 组件管理
  83. {
  84. name: 'miniApp.appManage',
  85. icon: 'icon-xiaochengxu-wx',
  86. path: '/miniApp/compConfig',
  87. access: "isShow",
  88. component: './MiniApp/CompConfig',
  89. },
  90. // 书币充值模板
  91. {
  92. name: 'miniApp.payModuleConfig',
  93. icon: 'icon-taojinbi-wx',
  94. path: '/miniApp/payModuleConfig',
  95. access: "isShow",
  96. component: './MiniApp/ModuleConfig',
  97. },
  98. // 数据统计中心
  99. {
  100. name:"miniApp.dataManage",
  101. icon: 'icon-shuju-wx',
  102. path: '/miniApp/dataManage',
  103. access: "isShow",
  104. routes: [
  105. {
  106. path: '/miniApp/dataManage',
  107. redirect: '/miniApp/dataManage/payLog',
  108. },
  109. {
  110. path: '/miniApp/dataManage/payLog',
  111. name: "payLog",
  112. component: './MiniApp/PayLog',
  113. },
  114. {
  115. path: '/miniApp/dataManage/readLog',
  116. name: "readLog",
  117. component: './MiniApp/ReadLog',
  118. },
  119. {
  120. name: 'consume',
  121. path: '/miniApp/dataManage/consume',
  122. component: './MiniApp/Consume',
  123. }
  124. ],
  125. },
  126. {
  127. name: 'miniApp.adBack',
  128. icon: 'icon-guanggaohuichuan-wx',
  129. path: '/miniApp/adBack',
  130. access: "isShow",
  131. component: './MiniApp/AdBack',
  132. },
  133. ]
  134. export default [
  135. {
  136. path: '/user',
  137. layout: false,
  138. routes: [
  139. {
  140. name: 'login',
  141. path: '/user/login',
  142. component: './User/Login',
  143. },
  144. ],
  145. },
  146. {
  147. path: '/',
  148. redirect: '/distributor/wxMiniApp',
  149. },
  150. {
  151. path: '*',
  152. layout: false,
  153. component: './404',
  154. },
  155. ...newMenu
  156. ];