ludu-cloud/mobile-web/src/api/user.js

111 lines
1.9 KiB
JavaScript
Raw Normal View History

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 }
})
}
export function GetAddressList(){
return request({
url: '/user-api/users/address/list',
2019-03-04 15:28:16 +08:00
method: 'get',
})
}
export function GetAddressById(id){
return request({
url: '/user-api/users/address/address',
2019-03-04 15:28:16 +08:00
method: 'get',
params: { id }
})
}
2019-04-06 18:26:57 +08:00
export function UpdateAddress(data){
return request({
url: '/user-api/users/address/update',
2019-04-06 18:26:57 +08:00
method: 'PUT',
params: data
})
}
2019-03-04 15:28:16 +08:00
export function SaveAddress(data){
return request({
url: '/user-api/users/address/add',
2019-04-06 18:26:57 +08:00
method: 'POST',
params: data
2019-03-04 15:28:16 +08:00
})
}
2019-04-06 18:26:57 +08:00
2019-03-04 15:28:16 +08:00
export function DelAddress(data){
return request({
url: '/user-api/users/address/remove',
2019-04-06 18:26:57 +08:00
method: 'DELETE',
params: data
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 }
})
}
export function getUserInfo() {
return request({
2019-04-08 23:17:14 +08:00
url: '/user-api/users/user/info',
method: 'get',
});
}
export function doUserUpdateNickname(nickname) {
return request({
2019-04-08 23:17:14 +08:00
url: '/user-api/users/user/update_nickname',
method: 'post',
params: {
nickname,
}
});
}
2019-03-04 15:28:16 +08:00
export function doPassportMobileRegister(mobile, code) {
return request({
2019-04-08 23:17:14 +08:00
url: '/user-api/users/passport/mobile/register',
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',
method: 'post',
params: {
mobile,
}
});
}