routes.tsx 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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.EmsCnpl",
  101. icon: 'icon-gongzhonghao-wx',
  102. path: '/miniApp/emsCnpl',
  103. access: "isShow",
  104. routes: [
  105. {
  106. path: '/miniApp/emsCnpl',
  107. redirect: '/miniApp/emsCnpl/auth',
  108. },
  109. {
  110. path:'/miniApp/emsCnpl/auth',
  111. name: "auth",
  112. component: './MiniApp/EmsCnpl/Auth',
  113. },
  114. {
  115. path:'/miniApp/emsCnpl/users',
  116. name: "users",
  117. component: './MiniApp/EmsCnpl/Users',
  118. },
  119. ],
  120. },
  121. // 企微
  122. {
  123. name:"miniApp.EntWeChat",
  124. icon: 'icon-qiyeweixin-wx',
  125. path: '/miniApp/entWeChat',
  126. access: "isShow",
  127. routes: [
  128. {
  129. path: '/miniApp/entWeChat',
  130. redirect: '/miniApp/entWeChat/auth',
  131. },
  132. {
  133. path: '/miniApp/entWeChat/auth',
  134. name: "auth",
  135. component: './MiniApp/EntWeChat/Auth',
  136. },
  137. {
  138. path: '/miniApp/entWeChat/users',
  139. name: "users",
  140. component: './MiniApp/EntWeChat/Users',
  141. },
  142. {
  143. path: '/miniApp/entWeChat/welcome',
  144. name: "welcome",
  145. component: './MiniApp/EntWeChat/Welcome',
  146. },
  147. ],
  148. },
  149. // 推广运营
  150. {
  151. name:"miniApp.Extend",
  152. icon: 'icon-zizhutuiguang-wx',
  153. path: '/miniApp/extend',
  154. access: "isShow",
  155. routes: [
  156. {
  157. path: '/miniApp/extend',
  158. redirect: '/miniApp/extend/book',
  159. },
  160. {
  161. path: '/miniApp/extend/book',
  162. name: "book",
  163. component: './MiniApp/Extend/Book',
  164. },
  165. {
  166. path: '/miniApp/extend/page',
  167. name: "page",
  168. component: './MiniApp/Extend/Page',
  169. },
  170. ],
  171. },
  172. // 数据统计中心
  173. {
  174. name:"miniApp.dataManage",
  175. icon: 'icon-shuju-wx',
  176. path: '/miniApp/dataManage',
  177. access: "isShow",
  178. routes: [
  179. {
  180. path: '/miniApp/dataManage',
  181. redirect: '/miniApp/dataManage/payLog',
  182. },
  183. {
  184. path: '/miniApp/dataManage/payLog',
  185. name: "payLog",
  186. component: './MiniApp/PayLog',
  187. },
  188. {
  189. path: '/miniApp/dataManage/readLog',
  190. name: "readLog",
  191. component: './MiniApp/ReadLog',
  192. },
  193. {
  194. name: 'consume',
  195. path: '/miniApp/dataManage/consume',
  196. component: './MiniApp/Consume',
  197. }
  198. ],
  199. },
  200. {
  201. name: 'miniApp.adBack',
  202. icon: 'icon-guanggaohuichuan-wx',
  203. path: '/miniApp/adBack',
  204. access: "isShow",
  205. component: './MiniApp/AdBack',
  206. },
  207. ]
  208. export default [
  209. {
  210. path: '/user',
  211. layout: false,
  212. routes: [
  213. {
  214. name: 'login',
  215. path: '/user/login',
  216. component: './User/Login',
  217. },
  218. ],
  219. },
  220. {
  221. path: '/',
  222. redirect: '/distributor/account',
  223. },
  224. {
  225. path: '*',
  226. layout: false,
  227. component: './404',
  228. },
  229. ...newMenu
  230. ];