qiao-weixin

3.2.3 • Public • Published

qiao-weixin

api

accessToken

'use strict';

var q = require('qiao-weixin');

var test = async function () {
  var appId = require('./config.json').AppID;
  var appSecret = require('./config.json').AppSecret;

  var accessToken = await q.accessToken(appId, appSecret);
  console.log(accessToken);
};

test();

mpCodeFile

'use strict';

var q = require('qiao-weixin');

var test = async function () {
  // accessToken
  var accessToken = '';

  // mp code file by api 1 : https://developers.weixin.qq.com/miniprogram/dev/api/getWXACode.html
  q.mpCodeFile(1, accessToken, { path: 'views/ucenter-register/ucenter-register' }, 'd:/test1.png');

  // mp code file by api 2 : https://developers.weixin.qq.com/miniprogram/dev/api/getWXACodeUnlimit.html
  q.mpCodeFile(2, accessToken, { page: 'views/ucenter-register/ucenter-register', scene: '1' }, 'd:/test2.png');

  // mp code file by api 3 : https://developers.weixin.qq.com/miniprogram/dev/api/createWXAQRCode.html
  q.mpCodeFile(3, accessToken, { path: 'views/ucenter-register/ucenter-register' }, 'd:/test3.png');
};

test();

mpCodeSrc

'use strict';

var q = require('qiao-weixin');

var test = async function () {
  // accessToken
  var accessToken = '';

  // mp code src by api 1 : https://developers.weixin.qq.com/miniprogram/dev/api/getWXACode.html
  var src1 = await q.mpCodeSrc(1, accessToken, {
    path: 'views/ucenter-register/ucenter-register',
  });

  // mp code src by api 2 : https://developers.weixin.qq.com/miniprogram/dev/api/getWXACodeUnlimit.html
  var src2 = await q.mpCodeSrc(2, accessToken, { page: 'views/ucenter-register/ucenter-register', scene: '1' }, 'jpg');

  // mp code src by api 3 : https://developers.weixin.qq.com/miniprogram/dev/api/createWXAQRCode.html
  var src3 = await q.mpCodeSrc(3, accessToken, { path: 'views/ucenter-register/ucenter-register' }, 'png');

  console.log(src1);
  console.log(src2);
  console.log(src3);
};

test();

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.2.34latest

Version History

VersionDownloads (Last 7 Days)Published
3.2.34
3.2.00
3.1.10
3.0.50
3.0.11
0.2.00
0.1.91
0.1.73
0.1.60
0.1.50
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.90
0.0.80
0.0.70

Package Sidebar

Install

npm i qiao-weixin

Weekly Downloads

9

Version

3.2.3

License

MIT

Unpacked Size

12.1 kB

Total Files

8

Last publish

Collaborators

  • npm_insistime