const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.subscribeMessage.send({
touser: event.openid,
page: event.page,
templateId: event.template,
data: event.data
})
console.log(result)
return [result,"1111111111"]
} catch (err) {
console.log(err)
console.error(err)
return [err,"xxxxxxxxxxxxxx"]
}
}
返回结果
mess OK
{errMsg: "cloud.callFunction:ok", result: Array(2), requestID: "9d1bc175-4755-11ea-9d9e-525400192d0e"}
errMsg: "cloud.callFunction:ok"
requestID: "9d1bc175-4755-11ea-9d9e-525400192d0e"
result: Array(2)
0: {}
1: "xxxxxxxxxxxxxx"
length: 2
nv_length: 2
__proto__: Array(0)
__proto__: Object
怎么按示例写的也用不了,参数都正确,不知道问题在那,需要怎么改才能发送订阅消息呢
同求