account.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { MockMethod } from 'vite-plugin-mock';
  2. import { resultSuccess, resultError } from '../_util';
  3. const userInfo = {
  4. name: 'Vben',
  5. userid: '00000001',
  6. email: 'test@gmail.com',
  7. signature: '海纳百川,有容乃大',
  8. introduction: '微笑着,努力着,欣赏着',
  9. title: '交互专家',
  10. group: '某某某事业群-某某平台部-某某技术部-UED',
  11. tags: [
  12. {
  13. key: '0',
  14. label: '很有想法的',
  15. },
  16. {
  17. key: '1',
  18. label: '专注设计',
  19. },
  20. {
  21. key: '2',
  22. label: '辣~',
  23. },
  24. {
  25. key: '3',
  26. label: '大长腿',
  27. },
  28. {
  29. key: '4',
  30. label: '川妹子',
  31. },
  32. {
  33. key: '5',
  34. label: '海纳百川',
  35. },
  36. ],
  37. notifyCount: 12,
  38. unreadCount: 11,
  39. country: 'China',
  40. address: 'Xiamen City 77',
  41. phone: '0592-268888888',
  42. };
  43. export default [
  44. {
  45. url: '/basic-api/account/getAccountInfo',
  46. timeout: 1000,
  47. method: 'get',
  48. response: () => {
  49. return resultSuccess(userInfo);
  50. },
  51. },
  52. {
  53. url: '/basic-api/user/sessionTimeout',
  54. method: 'post',
  55. statusCode: 401,
  56. response: () => {
  57. return resultError();
  58. },
  59. },
  60. ] as MockMethod[];