uniapp【修复】: 海报下载问题修复

This commit is contained in:
15093570141
2024-10-24 09:40:13 +08:00
parent 18afd5c79c
commit 40e05f817d

View File

@@ -349,12 +349,8 @@
uni.authorize({ uni.authorize({
scope: 'scope.writePhotosAlbum', scope: 'scope.writePhotosAlbum',
success() { success() {
// 先下载到本地
uni.downloadFile({
url: state.imgSrc,
success(res : any) {
uni.saveImageToPhotosAlbum({ uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, filePath: state.imgSrc,
success() { success() {
handleShowToast('保存成功', 'success'); handleShowToast('保存成功', 'success');
}, },
@@ -362,11 +358,6 @@
handleShowToast('图片保存失败', 'error'); handleShowToast('图片保存失败', 'error');
} }
}); });
},
fail() {
handleShowToast('下载失败', 'error');
}
})
} }
}) })
// #endif // #endif