保存图片到手机saveImageToPhotosAlbum()错误
wx.downloadFile({
url: ‘https://example?path=the_path&id=11111’,
success: function(res) {
let path = res.tempFilePath;
wx.saveImageToPhotosAlbum({
filePath: path,
success: function(res) {
wx.showModal({
title: “提示”,
content: “保存图片成功”,
showCancel: false
});
},
fail: function(res) {
wx.showModal({
title: “保存图片失败”,
content: res.errMsg,
showCancel: false
});
}
});
},
fail: function(res) {
wx.showModal({
title: “获取图片信息失败”,
content: res.errMsg,
showCancel: false
});
}
});