// 云函数入口函数
exports.main = async (event, context) => {
try{
const wxContext = cloud.getWXContext()
cloud.openapi.subscribeMessage.send({
touser: wxContext.OPENID,
templateId: ‘PJc0-vglZeKxeVITNoYfNgK0iNeBB2K3oJAJpeXckfU’,
page: /pages/discover-comment/discover-comment?blogId=${event.blogId}
,
data:{
thing3: {
value: event.content,
},
thing2:{
value: ‘评论成功’
}
},
miniprogramState: ‘developer’
})
return {
event,
openid: wxContext.OPENID,
appid: wxContext.APPID,
unionid: wxContext.UNIONID,
}
} catch(err) {
console.log(err);
}
}
微信服务通知没有订阅消息推送