ios下载base64图片报错file data is empty,安卓机可以
onShareLoad() {
const imgSrc = this.data.url;
const base64 = imgSrc.split('data:image/png;base64,')[1]
const save = wx.getFileSystemManager();
const number = Math.random();
save.writeFile({
filePath: wx.env.USER_DATA_PATH + '/pic' + number + '.jpg',
data: base64,
encoding: 'base64',
success: res => {
wx.saveImageToPhotosAlbum({
filePath: wx.env.USER_DATA_PATH + '/pic' + number + '.jpg',
success: (res) => {
this.setData({
isResetNoteContent: true
})
},
fail: (err) => {
console.log(err)
}
})
},
fail: err => {
console.log(err)
}
})
},

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
const base64 = imgSrc.split('data:image/webp;base64,')[1]
试试