Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

.umirc.ts 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. import { defineConfig } from '@umijs/max';
  2. import type { RequestConfig } from 'umi';
  3. export default defineConfig({
  4. antd: {},
  5. access: {},
  6. model: {},
  7. initialState: {},
  8. request: {},
  9. layout: {
  10. name: '菊城人才市场',
  11. logo: 'https://preview.pro.ant.design/static/logo.f0355d39.svg',
  12. // copy from pro site
  13. navTheme: 'dark',
  14. primaryColor: '#1890ff',
  15. layout: 'mix',
  16. contentWidth: 'Fluid',
  17. fixedHeader: true,
  18. fixSiderbar: false,
  19. splitMenus: true,
  20. siderWidth: 240,
  21. title: '菊城人才市场',
  22. pwa: false,
  23. iconfontUrl: '',
  24. avatarProps: {
  25. src: 'https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg',
  26. size: 'small',
  27. title: '七妮妮'
  28. },
  29. },
  30. routes: [
  31. {
  32. path: '/',
  33. redirect: '/main/company/list',
  34. },
  35. {
  36. path: '/login',
  37. component: './Login',
  38. layout: false
  39. },
  40. // 总控路由
  41. {
  42. name: '基础管理',
  43. path: '/main',
  44. routes: [
  45. {
  46. name: '企业管理',
  47. routes: [
  48. {
  49. name: '企业列表',
  50. path: '/main/company/list',
  51. component: './Main/Company/List',
  52. },
  53. {
  54. name: 'VIP列表',
  55. path: '/main/company/vip',
  56. component: './Main/Company/Vip',
  57. },
  58. {
  59. name: '部门管理',
  60. path: '/main/company/department',
  61. component: './Main/Company/Department',
  62. },
  63. {
  64. name: '职位管理',
  65. path: '/main/company/post',
  66. component: './Main/Company/Post',
  67. }
  68. ]
  69. },
  70. {
  71. name: '求职者管理',
  72. routes: [
  73. {
  74. name: '简历列表',
  75. path: '/main/jobseeker/list',
  76. component: './Main/Jobseeker/List',
  77. },
  78. {
  79. name: '求职者账号列表',
  80. path: '/main/jobseeker/account',
  81. component: './Main/Jobseeker/Account',
  82. }
  83. ]
  84. }
  85. ]
  86. },
  87. // 出租屋路由
  88. {
  89. name: '系统管理',
  90. path: '/rent',
  91. routes: [
  92. {
  93. name: '房屋管理',
  94. path: '/rent/house',
  95. component: './Rent/House',
  96. },
  97. {
  98. name: '租客管理',
  99. path: '/rent/renter',
  100. component: './Rent/Renter',
  101. },
  102. ]
  103. },
  104. // 学校路由
  105. {
  106. name: '账号权限',
  107. path: '/school',
  108. routes: [
  109. {
  110. name: '学校管理',
  111. path: '/school/address',
  112. component: './Main/Address',
  113. },
  114. {
  115. name: '学生管理',
  116. path: '/school/area',
  117. component: './Main/Area',
  118. },
  119. ]
  120. },
  121. ],
  122. npmClient: 'npm',
  123. });
  124. export const request: RequestConfig = {
  125. // 统一的请求设定
  126. baseURL: '',
  127. timeout: 1000,
  128. headers: {
  129. 'Content-Type': 'application/json'
  130. },
  131. // 请求拦截器
  132. requestInterceptors: [
  133. (config) => {
  134. sessionStorage.getItem('token') ? config.headers.Authorization = sessionStorage.getItem('token') : '';
  135. // 在发送请求之前做些什么
  136. return config;
  137. }
  138. ],
  139. // 响应拦截器
  140. responseInterceptors: [
  141. (response) => {
  142. // 拦截响应数据,进行个性化处理
  143. const { data } = response;
  144. if (!data.success) {
  145. }
  146. return response;
  147. }
  148. ]
  149. };