安卓手机微信小程序调用 wx.addFileToFavorites收藏pdf后无打开,ios就可以
uni.downloadFile({ url: reportObj.value.reportUrl, success: function (res) { if (res.statusCode === 200) { let filePath = res.tempFilePath console.log('下载成功', filePath, reportObj.value.title) // #ifdef MP-WEIXIN // 调用微信收藏文件接口 wx.addFileToFavorites({ filePath: filePath, fileName: reportObj.value.title + '.pdf', }) .then(() => { uni.hideLoading() setTimeout(() => { uni.showToast({ title: '已收藏到微信', }) }, 1000) }) .catch((err) => { uni.showToast({ title: '收藏失败', }) }) // #endif } },