config.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. // https://umijs.org/config/
  2. import { defineConfig } from 'umi';
  3. import defaultSettings from './defaultSettings';
  4. import proxy from './proxy';
  5. const { REACT_APP_ENV } = process.env;
  6. export default defineConfig({
  7. publicPath: './',
  8. hash: true,
  9. antd: {},
  10. dva: {
  11. hmr: true,
  12. },
  13. history: {
  14. type: 'hash',
  15. },
  16. locale: {
  17. // default zh-CN
  18. default: 'zh-CN',
  19. antd: true,
  20. // default true, when it is true, will use `navigator.language` overwrite default
  21. baseNavigator: true,
  22. },
  23. dynamicImport: {
  24. loading: '@/components/PageLoading/index',
  25. },
  26. targets: {
  27. ie: 11,
  28. },
  29. // umi routes: https://umijs.org/docs/routing
  30. routes: [
  31. {
  32. path: '/',
  33. component: '../layouts/BlankLayout',
  34. routes: [
  35. {
  36. path: '/user',
  37. component: '../layouts/UserLayout',
  38. routes: [
  39. {
  40. path: '/user/login',
  41. name: 'login',
  42. component: './User/login',
  43. },
  44. ],
  45. },
  46. // {
  47. // path: '/',
  48. // component: '../layouts/SecurityLayout',
  49. // routes: [
  50. // {
  51. // path: '/',
  52. // component: '../layouts/BasicLayout',
  53. // routes: [
  54. // {
  55. // path: '/',
  56. // redirect: '/agent/list',
  57. // },
  58. // {
  59. // path: '/agent',
  60. // name: '代理商管理',
  61. // icon: 'dashboard',
  62. // routes: [
  63. // {
  64. // name: '代理商列表',
  65. // icon: 'smile',
  66. // path: '/agent/list',
  67. // component: './agent/list',
  68. // }
  69. // ]
  70. // },
  71. // ]
  72. // }
  73. // ]
  74. // }
  75. {
  76. path: '/',
  77. component: '../layouts/BasicLayout',
  78. routes: [
  79. {
  80. path: '/',
  81. redirect: '/agent/list',
  82. },
  83. {
  84. path: '/agent',
  85. name: '代理商管理',
  86. icon: 'UserOutlined',
  87. routes: [
  88. {
  89. name: '代理商列表',
  90. path: '/agent/list',
  91. component: './agent/list',
  92. },
  93. ],
  94. },
  95. {
  96. path: '/tieba',
  97. name: '贴吧管理',
  98. icon: 'HomeOutlined',
  99. routes: [
  100. {
  101. name: '分类管理',
  102. icon: 'smile',
  103. path: '/tieba/Classify',
  104. component: './tieba/classify',
  105. },
  106. {
  107. name: '贴吧板块',
  108. icon: 'smile',
  109. path: '/tieba/plate',
  110. component: './tieba/plate',
  111. },
  112. {
  113. name: '帖子管理',
  114. icon: 'smile',
  115. path: '/tieba/posts',
  116. component: './tieba/posts',
  117. },
  118. ],
  119. },
  120. {
  121. path: '/notice',
  122. name: '通知管理',
  123. icon: 'MessageOutlined',
  124. routes: [
  125. {
  126. name: '公告管理',
  127. path: '/notice/notice',
  128. component: './notice',
  129. },
  130. ],
  131. },
  132. {
  133. path: '/club',
  134. name: '俱乐部管理',
  135. icon: 'CoffeeOutlined',
  136. component: './club',
  137. },
  138. {
  139. path: '/weapp',
  140. name: '小程序管理',
  141. icon: 'WechatOutlined',
  142. component: './weapp',
  143. },
  144. {
  145. path: '/complaint',
  146. name: '投诉管理',
  147. icon: 'AlertOutlined',
  148. routes: [
  149. {
  150. name: '帖子列表',
  151. icon: 'smile',
  152. path: '/complaint/admin',
  153. component: './complaint/admin',
  154. },
  155. ],
  156. },
  157. {
  158. path: '/setting',
  159. name: '设置',
  160. icon: 'SettingOutlined',
  161. routes: [
  162. {
  163. name: '首页轮播图',
  164. path: '/setting/banner',
  165. component: './setting/banner/index',
  166. },
  167. {
  168. name: '登录页背景图',
  169. path: '/setting/bgi',
  170. component: './setting/bgi/index',
  171. },
  172. ],
  173. },
  174. ],
  175. },
  176. ],
  177. },
  178. ],
  179. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  180. theme: {
  181. 'primary-color': defaultSettings.primaryColor,
  182. },
  183. title: false,
  184. ignoreMomentLocale: true,
  185. proxy: proxy[REACT_APP_ENV || 'dev'],
  186. manifest: {
  187. basePath: './',
  188. },
  189. });