Skip to content

微信二维码生成,包括临时二维码和永久二维码

Notifications You must be signed in to change notification settings

yxz1025/wx-qrcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wx-qrcode

微信二维码生成,包括临时二维码和永久二维码 支持express koa

###1、使用规则 var Qrcode = require('wx-qrocde'); var opts = { access_token: "access_token" };

  var qrcode = new Qrcode(opts);
  //临时二维码
  var limit_args = {"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}};
  qrcode.createLimitQrcode(limit_args).then(function(body){
      console.log(body);
      //返回格式          
      //{"ticket":"gQH47joAAAAAAAAAASxodHRwOi8vd2VpeGluLnFxLmNvbS9xL2taZ2Z3TVRtNzJXV1Brb3ZhYmJJAAIEZ23sUwMEmm
      3sUw==","expire_seconds":60,"url":"http:\/\/weixin.qq.com\/q\/kZgfwMTm72WWPkovabbI"}
  });
  
  //永久二维码
  var args = {"action_name": "QR_LIMIT_SCENE", "action_info": {"scene": {"scene_id": 123}}};
  //或者为
  var args = {"action_name": "QR_LIMIT_STR_SCENE", "action_info": {"scene": {"scene_str": "123"}}};
  
  qrcode.createQrcode(limit_args).then(function(body){
      console.log(body);
      //返回格式          
      //{"ticket":"gQH47joAAAAAAAAAASxodHRwOi8vd2VpeGluLnFxLmNvbS9xL2taZ2Z3TVRtNzJXV1Brb3ZhYmJJAAIEZ23sUwMEmm
      3sUw==","expire_seconds":60,"url":"http:\/\/weixin.qq.com\/q\/kZgfwMTm72WWPkovabbI"}
  });

About

微信二维码生成,包括临时二维码和永久二维码

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published