Commit 2a0e4d83 authored by 任国军's avatar 任国军

add wechat sendMsg

parent d71266ee
...@@ -29,6 +29,12 @@ class WechatService extends Service { ...@@ -29,6 +29,12 @@ class WechatService extends Service {
async sendMsg(data) { async sendMsg(data) {
const { ctx } = this; const { ctx } = this;
//只有MsgType为miniprogrampage才发送
if (!ctx.isEmpty(data.MsgType) || !ctx.isEmpty(data.Title) || data.MsgType != 'miniprogrampage' || data.Title != '趣选课') {
return;
}
const token = await this.getAccessToken(); const token = await this.getAccessToken();
const url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=' + token; const url = 'https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=' + token;
const params = { const params = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment