https://github.com/rayqian/youzan-sdk
官网的 node.js sdk
问题是 获取商品 好用, 但是添加商品 报 40005 错误
{"price":376.21,"title":"City Sightseeing","is_virtual":1,"post_fee":1.21}
(node:8808) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): {
"error_response": {
"code": 40005,
"msg": "??????"
}
}
var SDK = require('youzan-sdk');
var sdk = SDK({key: 'xxxxxx', secret: 'xxxxxxx'});
// 初始化SDK,在 https://koudaitong.com/v2/apps/open/setting 开启API接口,复制相应 AppID、AppSecert
export function getYouzan(req, res) {
sdk.get('kdt.items.onsale.get', {}).then(function(youzanProduct) {
// do some thing with data
res.json({youzanProduct});
});
}
export function addYouzan(req, res) {
console.log(req.body.product)
sdk.post('kdt.item.add', req.body.product,{}).then(function(data) {
// make some thing
res.json({data});
});
}
本帖最后由 极行客 于 2017-1-10 17:25 编辑
|
|
用手机打开
收藏
赞 0
···
回复
|
|
|
|