index.mock.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. import { SUCCESS_CODE } from '@/constants'
  2. const timeout = 1000
  3. export default [
  4. // 获取统计
  5. {
  6. url: '/mock/workplace/total',
  7. method: 'get',
  8. timeout,
  9. response: () => {
  10. return {
  11. code: SUCCESS_CODE,
  12. data: {
  13. project: 40,
  14. access: 2340,
  15. todo: 10
  16. }
  17. }
  18. }
  19. },
  20. // 获取项目
  21. {
  22. url: '/mock/workplace/project',
  23. method: 'get',
  24. timeout,
  25. response: () => {
  26. return {
  27. code: SUCCESS_CODE,
  28. data: [
  29. {
  30. name: 'Github',
  31. icon: 'akar-icons:github-fill',
  32. message: 'workplace.introduction',
  33. personal: 'Archer',
  34. time: new Date()
  35. },
  36. {
  37. name: 'Vue',
  38. icon: 'logos:vue',
  39. message: 'workplace.introduction',
  40. personal: 'Archer',
  41. time: new Date()
  42. },
  43. {
  44. name: 'Angular',
  45. icon: 'logos:angular-icon',
  46. message: 'workplace.introduction',
  47. personal: 'Archer',
  48. time: new Date()
  49. },
  50. {
  51. name: 'React',
  52. icon: 'logos:react',
  53. message: 'workplace.introduction',
  54. personal: 'Archer',
  55. time: new Date()
  56. },
  57. {
  58. name: 'Webpack',
  59. icon: 'logos:webpack',
  60. message: 'workplace.introduction',
  61. personal: 'Archer',
  62. time: new Date()
  63. },
  64. {
  65. name: 'Vite',
  66. icon: 'vscode-icons:file-type-vite',
  67. message: 'workplace.introduction',
  68. personal: 'Archer',
  69. time: new Date()
  70. }
  71. ]
  72. }
  73. }
  74. },
  75. // 获取动态
  76. {
  77. url: '/mock/workplace/dynamic',
  78. method: 'get',
  79. timeout,
  80. response: () => {
  81. return {
  82. code: SUCCESS_CODE,
  83. data: [
  84. {
  85. keys: ['workplace.push', 'Github'],
  86. time: new Date()
  87. },
  88. {
  89. keys: ['workplace.push', 'Github'],
  90. time: new Date()
  91. },
  92. {
  93. keys: ['workplace.push', 'Github'],
  94. time: new Date()
  95. },
  96. {
  97. keys: ['workplace.push', 'Github'],
  98. time: new Date()
  99. },
  100. {
  101. keys: ['workplace.push', 'Github'],
  102. time: new Date()
  103. },
  104. {
  105. keys: ['workplace.push', 'Github'],
  106. time: new Date()
  107. }
  108. ]
  109. }
  110. }
  111. },
  112. // 获取团队信息
  113. {
  114. url: '/mock/workplace/team',
  115. method: 'get',
  116. timeout,
  117. response: () => {
  118. return {
  119. code: SUCCESS_CODE,
  120. data: [
  121. {
  122. name: 'Github',
  123. icon: 'akar-icons:github-fill'
  124. },
  125. {
  126. name: 'Vue',
  127. icon: 'logos:vue'
  128. },
  129. {
  130. name: 'Angular',
  131. icon: 'logos:angular-icon'
  132. },
  133. {
  134. name: 'React',
  135. icon: 'logos:react'
  136. },
  137. {
  138. name: 'Webpack',
  139. icon: 'logos:webpack'
  140. },
  141. {
  142. name: 'Vite',
  143. icon: 'vscode-icons:file-type-vite'
  144. }
  145. ]
  146. }
  147. }
  148. },
  149. // 获取指数
  150. {
  151. url: '/mock/workplace/radar',
  152. method: 'get',
  153. timeout,
  154. response: () => {
  155. return {
  156. code: SUCCESS_CODE,
  157. data: [
  158. { name: 'workplace.quote', max: 65, personal: 42, team: 50 },
  159. { name: 'workplace.contribution', max: 160, personal: 30, team: 140 },
  160. { name: 'workplace.hot', max: 300, personal: 20, team: 28 },
  161. { name: 'workplace.yield', max: 130, personal: 35, team: 35 },
  162. { name: 'workplace.follow', max: 100, personal: 80, team: 90 }
  163. ]
  164. }
  165. }
  166. }
  167. ]