之前是可以,近期发现不行了,ios没问题,安卓有问题,下载文件在下载-微信-那里可以看到。但在相册没显示,不是授权问题,查看是有授权的。
wx.downloadFile({
url: vurl,
success: function (res) {
console.log(“suc:” + res)
console.log(res.tempFilePath);
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function (res1) {
console.log(“suc_saveImageToPhotosAlbum:” + res1)
wx.showToast({
title: ‘保存成功’,
icon: ‘loading’,
duration: 100
});
console.log(“suc_saveImageToPhotosAlbum:” + res1)
},
fail: function (res2) {
console.log(“err_saveImageToPhotosAlbum:” + res1)
wx.showToast({
title: ‘保存失败’,
icon: ‘loading’,
duration: 500
});
console.log(res2)
console.log(‘fail’)
}
})
},
fail: function (res1) {
wx.showToast({
title: vurl,
icon: ‘loading’,
duration: 1000
})
}
});