1***@qq.com
1***@qq.com
  • 发布:2020-09-22 11:06
  • 更新:2020-09-22 11:06
  • 阅读:874

uniapp移动端打包到本地后,保存图片失败

分类:uni-app
saveImg() {  
                uni.downloadFile({  
                    url: this.url,  

                    success: function(res) {  
                        if (res.statusCode === 200) {  
                            var file = res.tempFilePath  
                            console.log(res.tempFilePath)  
                            uni.saveImageToPhotosAlbum({  
                                filePath: res.tempFilePath,  
                                success: function(res) {  
                                    uni.showToast({  
                                        title: '保存成功',  
                                        icon: "none"  
                                    });  
                                },  
                                fail: function(res) {  

                                    uni.showModal({  
                                        title: res.errMsg,  
                                        content:file,  
                                    });  
                                }  
                            });  
                        }  

                    },  
                    fail: function() {  
                        console.log('fail')  
                    }  
                })  
            },
2020-09-22 11:06 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复