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({
scope: 'scope.writePhotosAlbum',
success() {
// 先下载到本地
uni.downloadFile({
url: state.imgSrc,
success(res : any) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success() {
handleShowToast('保存成功', 'success');
},
fail() {
handleShowToast('图片保存失败', 'error');
}
});
uni.saveImageToPhotosAlbum({
filePath: state.imgSrc,
success() {
handleShowToast('保存成功', 'success');
},
fail() {
handleShowToast('下载失败', 'error');
handleShowToast('图片保存失败', 'error');
}
})
});
}
})
// #endif