egg-duoduoke-sdk
v1.0.5
Published
[![NPM version][npm-image]][npm-url] [![build status][travis-image]][travis-url] [![Test coverage][codecov-image]][codecov-url] [![David deps][david-image]][david-url] [![Known Vulnerabilities][snyk-image]][snyk-url] [![npm download][download-image]][down
Downloads
2
Readme
egg-duoduoke-sdk
拼多多平台多多客的 sdk,核心内容为everywill提供,由作者封装为 Egg 插件供有需要的 Egg 开发者安装使用。
依赖的 egg 版本
| egg-duoduoke-sdk 版本 | egg 2.x | | --------------------- | ------- | | 2.x | 😁 | | 1.x | ❌ |
安装
$ npm i egg-duoduoke-sdk --save
开启插件
// config/plugin.js
exports.duoduokeSdk = {
enable: true,
package: "egg-duoduoke-sdk",
};
// config/config.default.js
config.duoduoke = {
clientId: "your clientId",
clientSecret: "your clientSecret",
};
// config/config.prod.js
config.duoduoke = {
clientId: "your clientId",
clientSecret: "your clientSecret",
endpoint: "https://gw-api.pinduoduo.com/api/router",
};
使用
const { goods_id_list } = ctx.request.body;
const commodityQuery = await ctx.duoduoke.execute(
"pdd.ddk.goods.basic.info.get",
{
goods_id_list,
}
);