【修复】修复新的海报组件保存图片到本地失败的问题。

This commit is contained in:
大灰灰
2022-08-04 23:19:33 +08:00
parent 41efafd150
commit 1210ec4e9f

View File

@@ -193,12 +193,9 @@
uni.authorize({ uni.authorize({
scope: 'scope.writePhotosAlbum', scope: 'scope.writePhotosAlbum',
success() { success() {
// 先下载到本地 console.log(image);
uni.downloadFile({
url: image,
success(res) {
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, filePath: image,
success() { success() {
_this.$refs.uToast.show({ message: '保存成功', type: 'success' }) _this.$refs.uToast.show({ message: '保存成功', type: 'success' })
}, },
@@ -208,12 +205,7 @@
}); });
}, },
fail() { fail() {
_this.$u.toast('下载失败') console.log('scope.writePhotosAlbum授权失败')
}
})
},
fail() {
//console.log('授权失败')
} }
}) })
// #endif // #endif