报错
{"errMsg":"openDocument:fail 文件不存在","errCode":-4,"code":-4}
代码片段:复制的官方示例都会提示文件不存在
uni.downloadFile({
url: 'https://example.com/somefile.pdf',
success: function (res) {
var filePath = res.tempFilePath;
console.log(filePath);
uni.openDocument({
filePath: 'https://example.com/somefile.pdf',
showMenu: true,
success: function (res) {
console.log('打开文档成功');
},
fail(error) {
console.log(error);
}
});
}
});
freesoul
这个问题解决了吗
2024-03-04 10:20