routes.tsx 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. 
  2. /**
  3. * @name umi 的路由配置
  4. * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
  5. * @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
  6. * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
  7. * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。
  8. * @param redirect 配置路由跳转
  9. * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验
  10. * @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题
  11. * @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
  12. * @doc https://umijs.org/docs/guides/routes
  13. */
  14. const newMenu = [
  15. // 分销商页面
  16. {
  17. path: '/distributor',
  18. redirect: '/distributor/account',
  19. },
  20. {
  21. name: 'distributor.account',
  22. icon: 'icon-zhanghaoguanli',
  23. path: '/distributor/account',
  24. access: "isShow",
  25. component: './Distributor/Account',
  26. },
  27. {
  28. name: 'distributor.appManage',
  29. icon: 'icon-yingyongguanliyuanguanli',
  30. path: '/distributor/appManage',
  31. access: "isShow",
  32. component: './Distributor/AppManage',
  33. },
  34. {
  35. name: 'distributor.appList',
  36. icon: 'icon-yingyongguanli',
  37. path: '/distributor/appList',
  38. access: "isShow",
  39. component: './Distributor/AppList',
  40. },
  41. {
  42. name: 'distributor.corpManage',
  43. icon: 'icon-qiwei_qiwei',
  44. path: '/distributor/corpManage',
  45. access: "isShow",
  46. component: './Distributor/CorpManage',
  47. },
  48. // {
  49. // name: 'distributor.wxMiniApp',
  50. // icon: 'icon-weixin',
  51. // path: '/distributor/wxMiniApp',
  52. // access: "isShow",
  53. // component: './Distributor/WxMiniApp',
  54. // },
  55. // {
  56. // name: 'distributor.dyMiniApp',
  57. // icon: 'icon-douyinzhanghao',
  58. // path: '/distributor/dyMiniApp',
  59. // access: "isShow",
  60. // component: './Distributor/DyMiniApp',
  61. // },
  62. // 小程序页面
  63. {
  64. path: '/miniApp',
  65. redirect: '/miniApp/book',
  66. },
  67. // 用户管理
  68. {
  69. path: '/miniApp/user',
  70. name: 'miniApp.user',
  71. icon: 'icon-zhanghaoguanli-wx',
  72. access: 'isShow',
  73. component: './MiniApp/MiniAppUser',
  74. },
  75. // 小说管理
  76. {
  77. path: '/miniApp/book',
  78. name: 'miniApp.book',
  79. icon: 'icon-xiaoshuo-wx',
  80. access: 'isShow',
  81. component: './MiniApp/BookManage',
  82. },
  83. // 组件管理
  84. {
  85. name: 'miniApp.appManage',
  86. icon: 'icon-xiaochengxu-wx',
  87. path: '/miniApp/compConfig',
  88. access: "isShow",
  89. component: './MiniApp/CompConfig',
  90. },
  91. // 书币充值模板
  92. {
  93. name: 'miniApp.payModuleConfig',
  94. icon: 'icon-taojinbi-wx',
  95. path: '/miniApp/payModuleConfig',
  96. access: "isShow",
  97. component: './MiniApp/ModuleConfig',
  98. },
  99. // 公众号
  100. {
  101. name: "miniApp.EmsCnpl",
  102. icon: 'icon-gongzhonghao-wx',
  103. path: '/miniApp/emsCnpl',
  104. access: "isShow",
  105. routes: [
  106. {
  107. path: '/miniApp/emsCnpl',
  108. redirect: '/miniApp/emsCnpl/auth',
  109. },
  110. {
  111. path: '/miniApp/emsCnpl/auth',
  112. name: "auth",
  113. component: './MiniApp/EmsCnpl/Auth',
  114. },
  115. {
  116. path: '/miniApp/emsCnpl/users',
  117. name: "users",
  118. component: './MiniApp/EmsCnpl/Users',
  119. },
  120. ],
  121. },
  122. // 企微
  123. {
  124. name: "miniApp.EntWeChat",
  125. icon: 'icon-qiyeweixin-wx',
  126. path: '/miniApp/entWeChat',
  127. access: "isShow",
  128. routes: [
  129. {
  130. path: '/miniApp/entWeChat',
  131. redirect: '/miniApp/entWeChat/auth',
  132. },
  133. {
  134. path: '/miniApp/entWeChat/auth',
  135. name: "auth",
  136. component: './MiniApp/EntWeChat/Auth',
  137. },
  138. {
  139. path: '/miniApp/entWeChat/users',
  140. name: "users",
  141. component: './MiniApp/EntWeChat/Users',
  142. },
  143. {
  144. path: '/miniApp/entWeChat/welcome',
  145. name: "welcome",
  146. component: './MiniApp/EntWeChat/Welcome',
  147. },
  148. ],
  149. },
  150. // 推广运营
  151. {
  152. name: "miniApp.Extend",
  153. icon: 'icon-zizhutuiguang-wx',
  154. path: '/miniApp/extend',
  155. access: "isShow",
  156. routes: [
  157. {
  158. path: '/miniApp/extend',
  159. redirect: '/miniApp/extend/book',
  160. },
  161. {
  162. path: '/miniApp/extend/book',
  163. name: "book",
  164. component: './MiniApp/Extend/Book',
  165. },
  166. {
  167. path: '/miniApp/extend/page',
  168. name: "page",
  169. component: './MiniApp/Extend/Page',
  170. },
  171. ],
  172. },
  173. // 数据统计中心
  174. {
  175. name: "miniApp.dataManage",
  176. icon: 'icon-shuju-wx',
  177. path: '/miniApp/dataManage',
  178. access: "isShow",
  179. routes: [
  180. {
  181. path: '/miniApp/dataManage',
  182. redirect: '/miniApp/dataManage/payLog',
  183. },
  184. {
  185. path: '/miniApp/dataManage/payLog',
  186. name: "payLog",
  187. component: './MiniApp/PayLog',
  188. },
  189. {
  190. path: '/miniApp/dataManage/readLog',
  191. name: "readLog",
  192. component: './MiniApp/ReadLog',
  193. },
  194. {
  195. name: 'consume',
  196. path: '/miniApp/dataManage/consume',
  197. component: './MiniApp/Consume',
  198. }
  199. ],
  200. },
  201. {
  202. name: 'miniApp.adBack',
  203. icon: 'icon-guanggaohuichuan-wx',
  204. path: '/miniApp/adBack',
  205. access: "isShow",
  206. component: './MiniApp/AdBack',
  207. },
  208. ]
  209. export default [
  210. {
  211. path: '/user',
  212. layout: false,
  213. routes: [
  214. {
  215. name: 'login',
  216. path: '/user/login',
  217. component: './User/Login',
  218. },
  219. ],
  220. },
  221. {
  222. path: '/',
  223. redirect: '/distributor/account'
  224. },
  225. {
  226. path: '*',
  227. layout: false,
  228. component: './404',
  229. },
  230. ...newMenu
  231. ];