mall-uniapp/sheep/api/member/address.js

54 lines
1.1 KiB
JavaScript
Raw Normal View History

import request from '@/sheep/request';
2023-12-16 12:02:31 +00:00
const AddressApi = {
// 获得用户收件地址列表
getAddressList: () => {
return request({
url: '/member/address/list',
2023-12-16 12:02:31 +00:00
method: 'GET'
});
},
2023-12-16 12:37:37 +00:00
// 创建用户收件地址
createAddress: (data) => {
return request({
url: '/member/address/create',
2023-12-16 12:37:37 +00:00
method: 'POST',
2024-01-20 09:28:04 +00:00
data,
custom: {
showSuccess: true,
successMsg: '保存成功'
},
2023-12-16 12:37:37 +00:00
});
},
// 更新用户收件地址
updateAddress: (data) => {
return request({
url: '/member/address/update',
2023-12-16 12:37:37 +00:00
method: 'PUT',
2024-01-20 09:28:04 +00:00
data,
custom: {
showSuccess: true,
successMsg: '更新成功'
},
2023-12-16 12:37:37 +00:00
});
},
// 获得用户收件地址
getAddress: (id) => {
return request({
url: '/member/address/get',
2023-12-16 12:37:37 +00:00
method: 'GET',
params: { id }
});
},
// 删除用户收件地址
deleteAddress: (id) => {
return request({
url: '/member/address/delete',
2023-12-16 12:37:37 +00:00
method: 'DELETE',
params: { id }
});
},
2023-12-16 12:02:31 +00:00
};
export default AddressApi;