一直报createDownloadTask:fail inval url,但是我的url是正确的
发布于 3 年前 作者 ytao 12273 次浏览 来自 问答

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 回复

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

回到顶部