收藏
回答

微信小程序wx.downloadFile下载文件,接口被拦截了怎么处理?


wx.downloadFile({
      url:'https://xxxxx' ,
      success:function(resData) {
        const tempFilePath = resData.tempFilePath
        wx.saveFile({
          tempFilePath: tempFilePath,
          success(res) {
            const savedFilePath = res.savedFilePath
            wx.openDocument({
              filePath: savedFilePath,
              success: function (res) {
                debugger
                console.log('打开文档成功')
              },
            });
          }
        })
      },
      fail:function(err) {
        wx.showToast({
          title: '下载失败',
        })
      }
    })


最后一次编辑于  11-04
回答关注问题邀请回答
收藏

1 个回答

问题标签