2024-01-05 01:21:52 +00:00
|
|
|
import request from '@/sheep/request';
|
2023-12-16 12:02:31 +00:00
|
|
|
|
|
|
|
const AddressApi = {
|
|
|
|
// 获得用户收件地址列表
|
|
|
|
getAddressList: () => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
url: '/member/address/list',
|
2023-12-16 12:02:31 +00:00
|
|
|
method: 'GET'
|
|
|
|
});
|
|
|
|
},
|
2023-12-16 12:37:37 +00:00
|
|
|
// 创建用户收件地址
|
|
|
|
createAddress: (data) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
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) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
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) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
url: '/member/address/get',
|
2023-12-16 12:37:37 +00:00
|
|
|
method: 'GET',
|
|
|
|
params: { id }
|
|
|
|
});
|
|
|
|
},
|
|
|
|
// 删除用户收件地址
|
|
|
|
deleteAddress: (id) => {
|
2024-01-05 01:21:52 +00:00
|
|
|
return request({
|
2024-01-20 05:13:28 +00:00
|
|
|
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;
|