const buffer = wx.base64ToArrayBuffer(base64Image),
// 文件名
filePath = `${wx.env.USER_DATA_PATH}/${timestamp}share.${format}`;
// 写文件
fsm.writeFile({
filePath,
data: buffer,
encoding: 'binary',
success(res) {
// 读取图片
wx.getImageInfo({
src: filePath,
success: function(res1) {
let img = res1.path;
// 把需要画出来的图片的临时url暴露出去
resolve(img);
reject();
},
fail(res1){
console.log('读取图片报错');
console.log(res1);
}
})
这个错误 {errMsg: "getImageInfo:fail invalid"} 版本号:"libVersion": "2.11.2",