接口请求及参数:
let option = {
method: 'POST',
// uri: address + '/product/coupon/get_list',
uri: address + '/product/coupon/get',
// uri: address + '/product/coupon/push',
form: {
// start_create_time: "2021-03-25 12:05:25",
// end_create_time: "2021-07-11 12:05:25",
// status: 3,
// page: 1,
// page_size: 10
coupon_id: 19759991
// openid: "ohKgO5KgG_inReaUYiY1PO7x974Y",
// openid: "ohKgO5JI4jhNGBUskMvVSVycoZts",
// coupon_id: 19187720
}
}
return await rp(option)
.then(function (res) {
console.log('res', res)
return JSON.parse(res)
})
问题:
/product/coupon/get_list//这个接口有2个优惠券,只能获取到一个
/product/coupon/get//这个接口一直报 错误码 100002
/product/coupon/push//这个接口一直报错误码 2
coupon_id: 19759991 //请求参数1
// data:{coupon_id: 19759991} //请求参数2
// coupon_id=19759991//请求参数3
// data:coupon_id:19759991 //请求参数4
// data:coupon_id=19759991 //请求参数5
}
// form:coupon_id=19759991 //请求参数6
let option = {
method: 'POST',
uri: address + '/product/coupon/get',
body: {
coupon_id: 19759991
},
json: true
}