手机:iphone11
微信版本号:IOS 7.0.12
基础库:2.10.3
base64编码串百度在线工具转换图片正常
wx.showLoading({title: "保存图片中..."}) // 显示loading
console.log('doSave');
const filePath = wx.env.USER_DATA_PATH + '/poster.png';
console.log(filePath);
const base64 = this.data.canvas.toDataURL();
const fileSystemManager = wx.getFileSystemManager();
fileSystemManager.writeFile({
filePath: filePath,
data: base64.slice(22),
encoding: 'base64',
success: (res) => {
console.log(res);
wx.saveImageToPhotosAlbum({
filePath: filePath,
success: res1 => {
console.log(res1);
wx.hideLoading();
wx.showToast({
title: '保存成功',
icon: 'success',
duration: 2000
})
},
fail: err => {
console.log(err);
}
});
},
fail: err1 => {
console.log(err1);
wx.hideLoading();
}
})
你好,麻烦提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)