index.js 466 B

12345678910111213141516171819202122232425262728293031
  1. import Mock from 'mockjs'
  2. const mock = [
  3. {
  4. url: "/dev-api/list/get",
  5. delay: 1000,
  6. method: 'get',
  7. response: () => {
  8. return {
  9. code: 200,
  10. msg: 'success',
  11. data: '返回数据内容'
  12. }
  13. }
  14. },
  15. {
  16. url: "/dev-api/list/error",
  17. delay: 1000,
  18. method: 'post',
  19. response: () => {
  20. return {
  21. code: 400,
  22. msg: '错误测试',
  23. data: null
  24. }
  25. }
  26. },
  27. ]
  28. export default mock