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

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

View File

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