点击发送,调用下面的函数,都说是sdk安装问题,可是,我照着安装调试了很多次了,依旧报错,
sendTest() {
const cloud = require('wx-server-sdk')
console.log(cloud,'aaaa')
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV,
})
exports.main = async (event, context) => {
console.log(333)
try {
console.log(1111)
const result = await cloud.openapi.subscribeMessage.send({
"touser": 'OPENID',
"page": 'index',
"lang": 'zh_CN',
"data": {
"number01": {
"value": '339208499'
},
"date01": {
"value": '2015年01月05日'
},
"site01": {
"value": 'TIT创意园'
},
"site02": {
"value": '广州市新港中路397号'
}
},
"templateId": 'TEMPLATE_ID',
"miniprogramState": 'developer'
})
console.log(222)
return result
} catch (err) {
return err
}
}
},