config.ts 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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: 'dashboard',
  88. routes: [
  89. {
  90. name: '代理商列表',
  91. icon: 'smile',
  92. path: '/agent/list',
  93. component: './agent/list',
  94. },
  95. ],
  96. },
  97. {
  98. path: '/tieba',
  99. name: '贴吧管理',
  100. icon: 'dashboard',
  101. routes: [
  102. {
  103. name: '分类管理',
  104. icon: 'smile',
  105. path: '/tieba/Classify',
  106. component: './tieba/classify',
  107. },
  108. {
  109. name: '贴吧板块',
  110. icon: 'smile',
  111. path: '/tieba/plate',
  112. component: './tieba/plate',
  113. },
  114. {
  115. name: '帖子管理',
  116. icon: 'smile',
  117. path: '/tieba/posts',
  118. component: './tieba/posts',
  119. },
  120. ],
  121. },
  122. {
  123. path: '/notice',
  124. name: '公告管理',
  125. icon: 'dashboard',
  126. component: './notice',
  127. },
  128. {
  129. path: '/club',
  130. name: '俱乐部管理',
  131. icon: 'dashboard',
  132. component: './club',
  133. },
  134. {
  135. path: '/complaint',
  136. name: '投诉管理',
  137. icon: 'dashboard',
  138. routes: [
  139. {
  140. name: '帖子列表',
  141. icon: 'smile',
  142. path: '/complaint/admin',
  143. component: './complaint/admin',
  144. },
  145. ],
  146. },
  147. ],
  148. },
  149. ],
  150. },
  151. ],
  152. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  153. theme: {
  154. 'primary-color': defaultSettings.primaryColor,
  155. },
  156. title: false,
  157. ignoreMomentLocale: true,
  158. proxy: proxy[REACT_APP_ENV || 'dev'],
  159. manifest: {
  160. basePath: './',
  161. },
  162. });