小程序云开发消息推送云函数调用成功,但是微信接收不到消息?
发布于 6 年前 作者 zhaoxia 5287 次浏览 来自 问答

云函数

exports.main = async (event, context) => {

 try {

   return await cloud.openapi.templateMessage.send({

     touser:event.openid,

     page:event.page,

     data: event.msgData,

     templateId: event.msgid,

     formId: event.formid

   })

 } catch (e) {

   console.error(e)

 }

消息体

var data = {

     openid: app.globalData.userInfo.userid,

     msgid: msgid,

     page: page

     formid: e.detail.formId,

     msgData: {

       thing1: { DATA: “2019-12-13” },

       time4: { DATA: “测试” }

     }

   }

云函数回调的结果

回到顶部