Commit 7ccd0ff1 authored by 任国军's avatar 任国军

fix wechat bug

parent 32d16f1c
Pipeline #22628 passed with stage
in 3 seconds
...@@ -51,12 +51,14 @@ class WechatService extends Service { ...@@ -51,12 +51,14 @@ class WechatService extends Service {
if (!flag) { if (!flag) {
this.ctx.set('content-type', 'text/xml'); this.ctx.set('content-type', 'text/xml');
const xml = `<xml> let xml = {
<ToUserName>${data.ToUserName}</ToUserName> MsgType: 'transfer_customer_service',
<FromUserName>${data.FromUserName}</FromUserName> ToUserName: data.ToUserName,
<CreateTime>${parseInt(new Date() / 1000)}</CreateTime> FromUserName: data.FromUserName,
<MsgType>transfer_customer_service</MsgType> CreateTime: parseInt(new Date() / 1000),
</xml>`; };
const builder = new xml2js.Builder();
xml = builder.buildObject(xml);
this.ctx.body = xml; this.ctx.body = xml;
ctx.logger.info('course_ctx: ' + JSON.stringify(this.ctx)); ctx.logger.info('course_ctx: ' + JSON.stringify(this.ctx));
} }
......
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