问题已解决 加个encoding:null 保留原始二进制数据就可以了
微信小程序利用云函数获取带参二维码遇到问题[代码]exports.main = async (event, context) => [代码][代码]new[代码] [代码]Promise((resolve, reject) => {//云函数[代码] [代码] [代码][代码]let url = [代码][代码]"https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token="[代码] [代码]+ event.at[代码][代码] [代码][代码]request({[代码][代码] [代码][代码]url,[代码][代码] [代码][代码]method: [代码][代码]'POST'[代码][代码],[代码][代码] [代码][代码]responseType: [代码][代码]'arraybuffer'[代码][代码],[代码][代码] [代码][代码]json: {[代码][代码] [代码] [代码] [代码][代码]page: [代码][代码]"pages/index/index"[代码][代码],[代码][代码] [代码][代码]scene:[代码][代码]"1234-231"[代码][代码] [代码][代码]}[代码][代码] [代码][代码]}, (err, res, body) => {[代码][代码] [代码][代码]resolve(res)[代码][代码] [代码][代码]}[代码][代码] [代码][代码])[代码][代码]})[代码][代码]wx.cloud.callFunction({//小程序端[代码][代码] [代码][代码]name: [代码][代码]'createqrcode'[代码][代码],[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]at:res.result.atdata[代码][代码] [代码][代码]},[代码][代码] [代码][代码]success: res345 => {[代码][代码] [代码][代码]console.log(res345.result)[代码][代码] [代码][代码]var[代码] [代码]base64 =wx.arrayBufferToBase64(res345.result)[代码][代码] [代码][代码]console.log([代码][代码]"base64:"[代码][代码]+base64)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码]返回值body是很多人文章提到的“乱码”,但加了[代码]responseType: [代码][代码]'arraybuffer'[代码]后获取的值扔到wx.arrayBufferToBase64()里仍然返回NULL,求解。或者各位有什么方法把这个返回值转成图片?
2019-01-26同,写入KeyList依然无效
开放域返回的kvdatalist长度永远是0[图片] [图片] [图片] [图片] [图片] 我照着教程做了好几次了,代码反反复复改了好多次。就行不行,求大神帮我看下一下
2019-01-16