system.ts 686 B

123456789101112131415161718192021222324252627282930
  1. import { MockMethod } from 'vite-plugin-mock';
  2. import { resultPageSuccess } from '../_util';
  3. const list = (() => {
  4. const result: any[] = [];
  5. for (let index = 0; index < 20; index++) {
  6. result.push({
  7. id: `${index}`,
  8. account: '@first',
  9. email: '@email',
  10. nickname: '@cname()',
  11. role: '@first',
  12. updateTime: '@datetime',
  13. remark: '@cword(0,20)',
  14. });
  15. }
  16. return result;
  17. })();
  18. export default [
  19. {
  20. url: '/api/system/getAccountList',
  21. timeout: 100,
  22. method: 'get',
  23. response: ({ query }) => {
  24. const { page = 1, pageSize = 20 } = query;
  25. return resultPageSuccess(page, pageSize, list);
  26. },
  27. },
  28. ] as MockMethod[];