wx.openDocument无法读取文件 ,提示文件或文件夹不在白名单中,麻烦帮忙解答?

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:22 3383 0 全屏看文

AI助手支持GPT4.0

wx.openDocument无法读取文件 ,提示文件或文件夹不在白名单中,麻烦帮忙解答?

我已经在开发者工具中勾选不检测域名选项,提示文件或文件夹不在白名单中,开发使用的基础库版本为2.11.1,已经尝试更换基础库版本,但是问题依旧未能得到解决。

wx.openDocument({      filePath'https://image.liangyikeji.net/test.pdf',      fileType: 'pdf',      success: function (res) {        console.log('打开文档成功')      }    })

I have checked the "do not detect domain name" option in the developer tool, indicating that the file or folder is not in the white list. The basic library version used for development is 2.11.1, and I have tried to change the basic library version, but the problem is still not solved. wx.openDocument ({      filePath: ' https://image.liangyikeji.net/test.pdf ',      fileType: 'pdf',      success: function (res) {         console.log ('Document opened successfully ')}})

回答:

Distance:

要先在后台配置downloadFile 域名,通过wx.downloadFile获取到本地临时路径,再调用wx.openDocument打开文件

Jie:好的,解决了,谢谢

-EOF-

AI助手支持GPT4.0