You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.1 KiB
63 lines
1.1 KiB
1 year ago
|
import request from "@/utils/request";
|
||
|
import {host} from "@/config/host";
|
||
|
|
||
|
/**
|
||
|
* 获取地址列表
|
||
|
* @param page
|
||
|
* @returns {Promise | Promise<unknown>}
|
||
|
*/
|
||
|
export function getAddressList(page){
|
||
|
return request({
|
||
|
url:`${host}/user/address-list`,
|
||
|
method: 'post',
|
||
|
data:{
|
||
|
page: page,
|
||
|
limit: 10
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 删除地址
|
||
|
* @param id
|
||
|
* @returns {Promise | Promise<unknown>}
|
||
|
*/
|
||
|
export function delAddress(id){
|
||
|
return request({
|
||
|
url:`${host}/user/address-del`,
|
||
|
method: 'post',
|
||
|
data:{
|
||
|
id
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 获取地址详情
|
||
|
* @param id
|
||
|
* @returns {Promise | Promise<unknown>}
|
||
|
*/
|
||
|
export function getDetail(id){
|
||
|
return request({
|
||
|
url:`${host}/user/address-info`,
|
||
|
method:"post",
|
||
|
data:{
|
||
|
id
|
||
|
}
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 更新地址信息
|
||
|
* @param data
|
||
|
* @returns {Promise | Promise<unknown>}
|
||
|
*/
|
||
|
export function saveAddress(data){
|
||
|
return request({
|
||
|
url:`${host}/user/address-upinfo`,
|
||
|
method:'post',
|
||
|
data:data
|
||
|
})
|
||
|
}
|
||
|
|