makaiqi

wx.request({
url: \'https://api.weixin.qq.com/cgi-bin/token\',
header: { \'content-type\': \'application/json\' },
data: {
grant_type: \'client_credential\',
appid:\'appid\'
secret: \'秘钥\'
},
success(res) {
accessToken = res.data.access_token
wx.request({
//url: \'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=\'+accessToken,
url: \'https://api.weixin.qq.com/wxa/getwxacode?access_token=\'+accessToken,
method: \'POST\',
responseType: \'arraybuffer\',
data: {
"path": \'扫码跳转的路径\',
"width": 430,
},
success(res) {
console.log(res.data)
let base64 = wx.arrayBufferToBase64(res.data)
console.log(base64)
let codeImg= \'data:image/PNG;base64,\' + base64

console.log(codeImg)
_this.sdd = codeImg
},
})
}
})

分类:

技术点:

相关文章:

  • 2021-10-15
  • 2021-04-13
  • 2021-11-27
  • 2022-02-15
  • 2021-12-09
猜你喜欢
  • 2021-07-05
  • 2021-09-11
  • 2021-11-05
  • 2021-12-13
  • 2021-12-23
  • 2021-12-26
相关资源
相似解决方案