dtk-nodejs-api-sdk

大淘客开发平台node调用方式

Usage no npm install needed!

<script type="module">
  import dtkNodejsApiSdk from 'https://cdn.skypack.dev/dtk-nodejs-api-sdk';
</script>

README

大淘客开放平台NodeJs SDK

项目安装

npm i dtk-nodejs-api-sdk

调用示例


const dtkSdk = require('dtk-nodejs-api-sdk');
/*
 *  @checkSign: 1 默认老版本验签  2 新版验签
 *  @appKey: 用户填写 appkey
 *  @appSecret: 用户填写 appSecret
 */ 
const sdk = new dtkSdk({appKey:'',appSecret:'',checkSign:1});

const getBrandList = sdk.request('接口地址',{
    method:"GET",
    /* 注意:form 里面就不用传appKey与appSecret  */
    form:{pageId:"1",pageSize:20,version:"v1.1.0"}
}).then((res)=>{
    console.log(res,'接口调用成功')
},(error,body)=>{
    console.log(error,'接口调用失败');
})