sample.ts 539 B

123456789101112131415161718192021222324252627
  1. import { MockMethod } from 'vite-plugin-mock';
  2. export default [
  3. {
  4. url: '/sample',
  5. method: 'get',
  6. // response: ({ query, body }: any) => {
  7. response: () => {
  8. return {
  9. code: 0,
  10. message: 'ok',
  11. data: {
  12. total: 2,
  13. list: [
  14. {
  15. id: 100,
  16. title: 'Mock测试数据100',
  17. },
  18. {
  19. id: 101,
  20. title: 'Mock测试数据101',
  21. },
  22. ],
  23. },
  24. };
  25. },
  26. },
  27. ] as MockMethod[];