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 {
if (!flag) {
this.ctx.set('content-type', 'text/xml');
const xml = `<xml>
<ToUserName>${data.ToUserName}</ToUserName>
<FromUserName>${data.FromUserName}</FromUserName>
<CreateTime>${parseInt(new Date() / 1000)}</CreateTime>
<MsgType>transfer_customer_service</MsgType>
</xml>`;
let xml = {
MsgType: 'transfer_customer_service',
ToUserName: data.ToUserName,
FromUserName: data.FromUserName,
CreateTime: parseInt(new Date() / 1000),
};
const builder = new xml2js.Builder();
xml = builder.buildObject(xml);
this.ctx.body = xml;
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