1.1.5 • Published 8 months ago

@xw-tech/egg-xw-taobao v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

针对淘宝联盟服务商接口/推广者接口进行请求封装,方便调用

使用方法

  1. 安装依赖包
npm install egg-tbk --save
  1. egg插件里开启
// app/plugin.js
exports.tbk = {
  enable: true,
  package: 'egg-tbk',
};
  1. 配置文件
// config/config.default.js 或其他配置文件
  config.tbk = {
    client: {
      appKey: '填写你在淘宝联盟应用的appkey',
      secret: '填写你的appSecret',
      restUrl: 'https://gw.api.taobao.com/router/rest',
    },
    app: true,
  };
  1. 使用
  const params = {
    adzone_id: '',
    material_dto: '',
    session: '',
  }
  const response = await this.ctx.app.tbk.request('taobao.tbk.sc.general.link.parse', params);
  1. 如果需要配置多个应用
config.tbk = {
    clients: {
      main: {
        appKey: '填写你在淘宝联盟应用的appkey',
        secret: '填写你的appSecret',
        restUrl: 'https://gw.api.taobao.com/router/rest',
      },
      sub: {
        appKey: '填写你在淘宝联盟应用的appkey',
        secret: '填写你的appSecret',
        restUrl: 'https://gw.api.taobao.com/router/rest',
      }
    },
    app: true,
  };
  1. 使用
const params = {
    adzone_id: '',
    material_dto: '',
    session: '',
  }
  const response = await this.ctx.app.tbk.get('main').request('taobao.tbk.sc.general.link.parse', params);
1.1.5

8 months ago

1.1.4

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago