2019-03-04 15:28:16 +08:00
|
|
|
import request from "../config/request";
|
|
|
|
|
|
|
|
export function GetFavorite(data){
|
|
|
|
return request({
|
|
|
|
url: '/User/GetFavorite',
|
|
|
|
method: 'post',
|
|
|
|
params: { data }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function DelFavorite(id){
|
|
|
|
return request({
|
|
|
|
url: '/User/DelFavorite',
|
|
|
|
method: 'get',
|
|
|
|
params: { id:id }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-07-09 23:54:36 +08:00
|
|
|
export function hasUserSpuFavorite(spuId){
|
|
|
|
return request({
|
|
|
|
url: '/user-api/users/favorite/hasUserFavorite',
|
|
|
|
method: 'get',
|
|
|
|
params: {spuId}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-03-04 15:28:16 +08:00
|
|
|
export function GetCoupon(data){
|
|
|
|
return request({
|
|
|
|
url: '/User/GetCoupon',
|
|
|
|
method: 'Post',
|
|
|
|
params: { data }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function ExchangeCoupon(code){
|
|
|
|
return request({
|
|
|
|
url: '/User/ExchangeCoupon',
|
|
|
|
method: 'Post',
|
|
|
|
params: { code:code }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2019-03-27 19:12:12 +08:00
|
|
|
export function getUserInfo() {
|
|
|
|
return request({
|
2019-04-08 23:17:14 +08:00
|
|
|
url: '/user-api/users/user/info',
|
2019-03-27 19:12:12 +08:00
|
|
|
method: 'get',
|
2019-03-28 19:19:04 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function doUserUpdateNickname(nickname) {
|
|
|
|
return request({
|
2019-04-08 23:17:14 +08:00
|
|
|
url: '/user-api/users/user/update_nickname',
|
2019-03-28 19:19:04 +08:00
|
|
|
method: 'post',
|
|
|
|
params: {
|
|
|
|
nickname,
|
2019-03-27 19:12:12 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2019-03-04 15:28:16 +08:00
|
|
|
|
2019-03-27 19:12:12 +08:00
|
|
|
export function doPassportMobileRegister(mobile, code) {
|
|
|
|
return request({
|
2019-04-08 23:17:14 +08:00
|
|
|
url: '/user-api/users/passport/mobile/register',
|
2019-03-27 19:12:12 +08:00
|
|
|
method: 'post',
|
|
|
|
params: {
|
|
|
|
mobile,
|
|
|
|
code,
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function doPassportMobileSendRegisterCode(mobile) {
|
|
|
|
return request({
|
2019-04-08 23:17:14 +08:00
|
|
|
url: '/user-api/users/passport/mobile/send_register_code',
|
2019-03-27 19:12:12 +08:00
|
|
|
method: 'post',
|
|
|
|
params: {
|
|
|
|
mobile,
|
|
|
|
}
|
|
|
|
});
|
2019-03-28 19:19:04 +08:00
|
|
|
}
|
2019-04-10 22:27:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------- address
|
|
|
|
|
|
|
|
export function GetAddressList(){
|
|
|
|
return request({
|
|
|
|
url: '/user-api/users/address/list',
|
|
|
|
method: 'get',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function GetAddressById(id){
|
|
|
|
return request({
|
|
|
|
url: '/user-api/users/address/address',
|
|
|
|
method: 'get',
|
|
|
|
params: { id }
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function GetDefaultAddress(){
|
|
|
|
return request({
|
|
|
|
url: '/user-api/users/address/default_address',
|
|
|
|
method: 'get',
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function UpdateAddress(data){
|
|
|
|
return request({
|
|
|
|
url: '/user-api/users/address/update',
|
|
|
|
method: 'PUT',
|
|
|
|
params: data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function SaveAddress(data){
|
|
|
|
return request({
|
|
|
|
url: '/user-api/users/address/add',
|
|
|
|
method: 'POST',
|
|
|
|
params: data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
export function DelAddress(data){
|
|
|
|
return request({
|
|
|
|
url: '/user-api/users/address/remove',
|
|
|
|
method: 'DELETE',
|
|
|
|
params: data
|
|
|
|
})
|
|
|
|
}
|