wx.downloadFile开发工具中正常,体验/正式保存失败是什么原因?
发布于 5 年前 作者 zhangchao 15130 次浏览 来自 官方Issues
downLoadHandle(src) {
        wx.downloadFile({
            url: src,
            success:function (res) {
                wx.saveImageToPhotosAlbum({
                    filePath: res.tempFilePath,
                    success:function (data) {
                        wx.showToast({
                            title'保存到相册成功',
                            duration500
                        })
                    },
                    fail:function(err) {
                        wx.showToast({
                            icon'none',
                            title'保存到相册失败',
                            duration500
                        })
                    }
                })
            },
            fail: function(err) {
                wx.showToast({
                    icon'none',
                    title'保存失败',
                    duration500
                })
            }
        })
    }
2 回复

这个有没有进行配置呢,下载需要配置合法域名的,本地正常应该是你勾选了不验证合法域名

回到顶部