log.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. import { http } from '@/utils/http/axios';
  2. import {
  3. LoginLogPageRequest,
  4. LoginLogResponse,
  5. OperationLogResponse,
  6. OperationLogPageRequest,
  7. SystemLogRequest,
  8. SystemLogResponse,
  9. SystemExport,
  10. OperationPageDetail,
  11. OperationExport,
  12. } from '@/types/log/type';
  13. /**
  14. *@description: V4: 获取登录日志列表
  15. */
  16. export function queryLoginLogList(data: LoginLogPageRequest) {
  17. return http.request<LoginLogResponse>({
  18. url: '/admin/log/queryLoginLogPage',
  19. method: 'post',
  20. data: data,
  21. });
  22. }
  23. /**
  24. * @description: @v4:登录日志导出 admin/log/exportLoginLog
  25. */
  26. export function exportLoginLog(data: LoginLogPageRequest) {
  27. return http.request(
  28. {
  29. url: '/admin/log/exportLoginLog',
  30. method: 'post',
  31. responseType: 'blob',
  32. data,
  33. },
  34. { isTransformResponse: false },
  35. );
  36. }
  37. /**
  38. *@description: V4: 获取操作日志列表
  39. */
  40. export function queryOperationLogList(data: OperationLogPageRequest) {
  41. return http.request<OperationLogResponse>({
  42. url: '/admin/log/queryLogPage',
  43. method: 'post',
  44. data: data,
  45. });
  46. }
  47. /**
  48. * @description: @v4:操作日志导出 admin/log/exportLog
  49. */
  50. export function exportOperationLog(data: OperationExport) {
  51. return http.request(
  52. {
  53. url: '/admin/log/exportLog',
  54. method: 'post',
  55. responseType: 'blob',
  56. data,
  57. },
  58. { isTransformResponse: false },
  59. );
  60. }
  61. /**
  62. *@description: V4: 获取操作日志详情
  63. */
  64. export function queryOperationLogDetail(id: number) {
  65. return http.request<OperationPageDetail>({
  66. url: `/admin/log/queryLogDetail?id=${id}`,
  67. method: 'get',
  68. });
  69. }
  70. /**
  71. *@description: V4: 获取系统日志列表
  72. */
  73. export function querySystemLogList(data: SystemLogRequest) {
  74. return http.request<SystemLogResponse>({
  75. url: '/admin/log/queryEventLogPage',
  76. method: 'post',
  77. data: data,
  78. });
  79. }
  80. /**
  81. * @description: @v4:系统日志导出 admin/log/exportEventLog
  82. */
  83. export function exportSystemLog(data: SystemExport) {
  84. return http.request(
  85. {
  86. url: '/admin/log/exportEventLog',
  87. method: 'post',
  88. responseType: 'blob',
  89. data,
  90. },
  91. { isTransformResponse: false },
  92. );
  93. }