nodejs发送统一服务消息报错47001,网上查说是模板解析json有问题,也就是代码里的data,哪位大佬分析一下哪里有问题呀?感谢感谢!
let msg= {
"touser": "o3ltM5CuCpZEsyVp6c4j6uAog4Y4",
"mpTemplateMsg": {
"appid": "wx88ccedd3284e305a",
"url": "http://weixin.qq.com/download",
"templateId": "rkEsP2kuSEgoa1yrs-Fg4p91mCdPuiUtLe50TlV6sB0",
"miniprogram": {
"appid": "wx1bc13d2103ff2668",
"pagepath": '/pages/index/index',
},
"data": {
"first": {
"value": "1",
"color": "#173177"
},
"keyword1": {
"value": "2",
"color": "#173177"
},
"keyword2": {
"value": "3",
"color": "#173177"
},
"remark": {
"value": "4",
"color": "#173177"
}
}
}
}
sendopt = {
method:'POST',
uri:'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token='+asstoken,
body:msg,
json: true,
headers:{
'Content-Type':'application/json'
}
}
let send = await rq(sendopt)
console.log(send)
你好,麻烦提供下返回的rid
errcode: 47001,
errmsg: data format error rid: 6263abe7-45f8afc0-4ae19083
}
仔细看看文档,不是驼峰,是下划线