index.ts 4.1 KB

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