微信公众平台示例项目
拷贝 .env.example 为 .env,替换成你申请的公众号的配置信息。
git clone https://github.com/clovery/wechat-starter.git
cd wechat-starter
npm install
npm start
在微信后台开发者模式中填写正确的回调URL:[rootServer]/wechat
申请测试号 https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index
https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
"errcode":45015,"errmsg":"response out of time limit or subscription is canceled。
导致上面报错的原因是用户会话超时,这时需要使用 “模板消息接口” 推送信息给用户。