config.ts 5.0 KB

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