await $w.cloud
.getTempFileURL(
fileid
)
.then(async function (url) {
console.log("url", url);
await wx.downloadFile({
url: url,
success: function (res) {
console.log("下载成功地址", res)
wx.shareFileMessage({
filePath: res.tempFilePath,
success() { console.log("成功") },
fail(res) { console.log("失败", res); console.log("地址", res.tempFilePath) }
})
},
fail: function (b) {
console.log("失败", b)
}
})
})
这里首次调用shareFileMessage,会报错,报错信息shareFileMessage失败 {"errMsg": "shareFileMessage:fail can only be invoked by user TAP gesture."}
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)
改为同步写法,试一下还会问题嘛