小程序调用云函数发送订阅消息,为啥总是报错呢?
总是报错:“openapi.customerServiceMessage.send:fail response out of time limit or subscription is canceled rid: 5fe71a4c-484a30a3-525f5d9a”,
我的云函数:
// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
})
// 云函数入口函数
exports.main = async (event, context) => {
try {
return await cloud.openapi.customerServiceMessage.send({
touser: event.openid,
page: "pages/index/index",
data: {
thing2: {
value: "灰狼编程",
},
thing3: {
value: "这是很好的一门课"
}
},
templateId: "-swmuIHPkg9ir2rFyX81jav6W0N0a6rEV3lQcWBR7Dk"
})
} catch (err) {
console.log(err);
return err;
}
}
这是为啥呢?写的没错误呀