一直报createDownloadTask:fail inval url,但是我的url是正确的

发布于 4 年前作者 ytao12624 次浏览最后编辑 4 年前来自 ask

https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html

wx.downloadFile({

              url: url,//http://localhost:8080/...../xxx.pdf

              success: function (res) {

                const filePath = res.tempFilePath

                wx.openDocument({

                  filePath: filePath,

                  success: function (res) {

                    console.log('打开文档成功')

                  },

                  fail:function(err){

                    console.log(err)

                  }

                })

              },

              fail:function(err){

                console.log(err)


              }

            }

1 回复
fcheng
fcheng1 楼20 天前

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html