希望小程序的 onShareAppMessage 中的 image 支持云开发
发布于 6 年前 作者 tianping 14111 次浏览 来自 问答
  • 需求的场景描述(希望解决的问题):目前小程序的 Page 生命周期中的 onShareAppMessage 的 imageUrl 无法识别云开发的文件路径。
  • 希望提供的能力:onShareAppMessage 中的 imageUrl 提供云开发文件路径的支持

尝试绕过方式

wx.cloud.getTempFileURL({
        fileList: [this.data.store.images[0]],
        success: res =>{
          return {
            title: 'here is title'
            path: path,
            imageUrl: res.fileList[0].tempFileURL
          }
        },
        fail: error => {
          console.error("出现Bug了",error)
        }
      })
2 回复

用云文件 ID 换取真实链接。有效期,默认一天且最大不超过一天

https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-client-api/storage/getTempFileURL.html

建议还是用腾讯的cos  或者其他对象存储

回到顶部