config.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. hash: true,
  8. antd: {},
  9. dva: {
  10. hmr: true,
  11. },
  12. history: {
  13. type: 'hash',
  14. },
  15. locale: {
  16. // default zh-CN
  17. default: 'zh-CN',
  18. antd: true,
  19. // default true, when it is true, will use `navigator.language` overwrite default
  20. baseNavigator: true,
  21. },
  22. dynamicImport: {
  23. loading: '@/components/PageLoading/index',
  24. },
  25. targets: {
  26. ie: 11,
  27. },
  28. // umi routes: https://umijs.org/docs/routing
  29. routes: [
  30. {
  31. path: '/',
  32. component: '../layouts/BlankLayout',
  33. routes: [
  34. {
  35. path: '/user',
  36. component: '../layouts/UserLayout',
  37. routes: [
  38. {
  39. path: '/user/login',
  40. name: 'login',
  41. component: './User/login',
  42. },
  43. {
  44. path: '/user',
  45. redirect: '/user/login',
  46. },
  47. {
  48. name: 'register-result',
  49. icon: 'smile',
  50. path: '/user/register-result',
  51. component: './user/register-result',
  52. },
  53. {
  54. name: 'register',
  55. icon: 'smile',
  56. path: '/user/register',
  57. component: './user/register',
  58. },
  59. {
  60. component: '404',
  61. },
  62. ],
  63. },
  64. {
  65. path: '/',
  66. component: '../layouts/BasicLayout',
  67. routes: [
  68. {
  69. path: '/',
  70. redirect: '/agent/list',
  71. },
  72. {
  73. path: '/agent',
  74. name: '代理商管理',
  75. icon: 'dashboard',
  76. routes: [
  77. {
  78. name: '代理商列表',
  79. icon: 'smile',
  80. path: '/agent/list',
  81. component: './agent/list',
  82. }
  83. ]
  84. },
  85. {
  86. path: '/tieba',
  87. name: '贴吧管理',
  88. icon: 'dashboard',
  89. routes: [
  90. {
  91. name: '分类管理',
  92. icon: 'smile',
  93. path: '/tieba/Classify',
  94. component: './tieba/classify',
  95. },
  96. {
  97. name: '贴吧板块',
  98. icon: 'smile',
  99. path: '/tieba/plate',
  100. component: './tieba/plate',
  101. },
  102. {
  103. name: '帖子管理',
  104. icon: 'smile',
  105. path: '/tieba/posts',
  106. component: './tieba/posts',
  107. },
  108. ]
  109. },
  110. {
  111. path: '/notice',
  112. name: '公告管理',
  113. icon: 'dashboard',
  114. component: './notice',
  115. },
  116. {
  117. path: '/complaint',
  118. name: '投诉管理',
  119. icon: 'dashboard',
  120. routes: [
  121. {
  122. name: '帖子列表',
  123. icon: 'smile',
  124. path: '/complaint/admin',
  125. component: './complaint/admin',
  126. }
  127. ]
  128. }
  129. ]
  130. }
  131. ],
  132. },
  133. ],
  134. // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  135. theme: {
  136. 'primary-color': defaultSettings.primaryColor,
  137. },
  138. title: false,
  139. ignoreMomentLocale: true,
  140. proxy: proxy[REACT_APP_ENV || 'dev'],
  141. manifest: {
  142. basePath: '/',
  143. },
  144. });