wx-js-utils icon indicating copy to clipboard operation
wx-js-utils copied to clipboard

[bug] 示例里 getQR 这里写成了path

Open Lucassssss opened this issue 2 years ago • 0 comments

https://github.com/lcxfs1991/wx-js-utils/blob/f1b39b0567cc9f3eda7144c154d163383c95b273/src/libs/WXMINIQR.js#L38

示例里这里写了path,应该是 page,另外这个接口返回的数据buffer在对象下面。实际生成的时候这个接口失败,生成文件一般是几个 byte.

这里使用云开发的话:

// 生成
let qrResult = await cloud.openapi.wxacode.getUnlimited({
  page: 'pages/hello/hello',
  scene: 'code=123',
  checkPath: false,
  envVersion: "develop",
})
// 上传
const cloudPath = await cloud.uploadFile({
  cloudPath: filename.png,
  fileContent: qrResult.buffer
})
// 云端这个接口需要配置权限  
// config.json
{
  "permissions": {
    "openapi": [
      "wxacode.getUnlimited"
    ]
  }
}

返回结果结构有误,另外微信新增了 checkPathenvVersion等新的参数。

Lucassssss avatar Nov 09 '21 13:11 Lucassssss