history.js 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import request from '@/sheep/request';
  2. import {
  3. t
  4. } from '@/locale';
  5. const SpuHistoryApi = {
  6. // 删除商品浏览记录
  7. deleteBrowseHistory: (spuIds) => {
  8. return request({
  9. url: '/product/browse-history/delete',
  10. method: 'DELETE',
  11. data: { spuIds },
  12. custom: {
  13. showSuccess: true,
  14. successMsg: t('common.delete_success'),
  15. },
  16. });
  17. },
  18. // 清空商品浏览记录
  19. cleanBrowseHistory: () => {
  20. return request({
  21. url: '/product/browse-history/clean',
  22. method: 'DELETE',
  23. custom: {
  24. showSuccess: true,
  25. successMsg: t('common.clear_success'),
  26. },
  27. });
  28. },
  29. // 获得商品浏览记录分页
  30. getBrowseHistoryPage: (data) => {
  31. return request({
  32. url: '/product/browse-history/page',
  33. method: 'GET',
  34. data,
  35. custom: {
  36. showLoading: false
  37. },
  38. });
  39. },
  40. };
  41. export default SpuHistoryApi;