address.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import request from '@/sheep/request';
  2. const AddressApi = {
  3. // 获得用户收件地址列表
  4. getAddressList: () => {
  5. return request({
  6. url: '/member/address/list',
  7. method: 'GET'
  8. });
  9. },
  10. // 创建用户收件地址
  11. createAddress: (data) => {
  12. return request({
  13. url: '/member/address/create',
  14. method: 'POST',
  15. data,
  16. custom: {
  17. showSuccess: true,
  18. successMsg: '保存成功'
  19. },
  20. });
  21. },
  22. // 更新用户收件地址
  23. updateAddress: (data) => {
  24. return request({
  25. url: '/member/address/update',
  26. method: 'PUT',
  27. data,
  28. custom: {
  29. showSuccess: true,
  30. successMsg: '更新成功'
  31. },
  32. });
  33. },
  34. // 获得用户收件地址
  35. getAddress: (id) => {
  36. return request({
  37. url: '/member/address/get',
  38. method: 'GET',
  39. params: { id }
  40. });
  41. },
  42. // 删除用户收件地址
  43. deleteAddress: (id) => {
  44. return request({
  45. url: '/member/address/delete',
  46. method: 'DELETE',
  47. params: { id }
  48. });
  49. },
  50. };
  51. export default AddressApi;