【小程序】安卓分享pdf为.bin格式,该如何解决?
downloadFile下载获取的pdf后缀是.bin,openDocument之后 ios分享给好友是 pdf 格式 但是安卓分享是 .bin 格式 。请问该如何解决 ,代码如下: uni.downloadFile({
url: response.data.data,
success: function (res) {
console.log('下载的res', res)
var filePath = res.tempFilePath;
console.log(filePath);
uni.openDocument({
filePath: filePath,
showMenu: true,
fileType: 'pdf',
success: function (res) {
uni.hideLoading()
console.log('打开文档成功')
},
fail: function (err) {
uni.hideLoading()
uni.showToast({
title: '打开失败',
duration: 1500,
icon: 'none'
})
console.log('打开失败')
}
})
},
fail: function (err) {
console.log('下载失败原因', err)
uni.hideLoading()
setTimeout(() => {
uni.showToast({
title: '下载失败',
duration: 1500,
icon: 'none'
})
}, 1500)
}
})