收藏
回答

wx.downloadFile打开https文件失败?

放在新创建的文件夹里面,默认域名获取文件不成功  
 wx.downloadFile({
        url: 'https://hangkonglilunloud.com/s。。。。。。。。。。省略‘

        success: function (res) {
          var filePath = res.tempFilePath;
          console.log("filePath", filePath)
          wx.openDocument({
            filePath: filePath,
            success: function (res) {
              wx.hideLoading()
              console.log('打开文档成功' + res)
            },


            fail: function (res) {
              console.log("filePath", res.tempFilePath)
              console.log('打开文档失败');
            },
            complete: function (res) {
              console.log(


提示:https://hangkonglilun-1256377430.cos.ap-chengdu.myqcloud.com 不在以下 downloadFile 合法域名列表中,请参考文档:https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html

d但是我将文件换个文件夹放置,获取文件就成功

https://guizhangpdf-。。。。。。。省略。。。

z这是为什么,

z仔细查看了。甚至对比了两个文件夹权限,没有区别呀?????
回答关注问题邀请回答
收藏

1 个回答

  • 正周
    正周
    2020-04-27
    按照报错提示把downloadFile 合法域名添加一下
    


    2020-04-27
    有用
    回复
登录 后发表内容
问题标签