uni.downloadFile({
url: 'http://txxx.shundaoyun.com/weixin/123.pdf',
success: function (res) {
var filePath = res.tempFilePath;
console.log(res.tempFilePath);
uni.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功');
}
});
}
});
console提示打开文档成功,但并没有打开pdf文档,页面没变化,请问这是怎么回事

6***@qq.com
- 发布:2020-03-21 10:04
- 更新:2020-04-08 11:16
- 阅读:3332
uni.openDocument 无法打开pdf文件
分类:HBuilderX
1 个回复
[已删除]
url的路径必须在小程序的域名白名单,有专门的uploadFile的域名;
域名必须是https的;