createQRCode方法的返回值怎么展示出来呢?
createQRCode云调用的返回值是
{
"errcode": 0,
"errmsg": "ok",
"contentType": "image/jpeg",
"buffer": Buffer
}我已经调用成功了,但是小弟才疏学浅,没弄明白怎么把这个图片解析出来,望大神指点,最好给出具体的代码实现,谢啦
2 回复
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.wxacode.getUnlimited({
scene: 'a=1'
})
return await cloud.uploadFile({
cloudPath: 'qrcode.jpg',
fileContent: result.buffer,
})
} catch (err) {
console.log(err)
return err
}
}