Commit ca242b42 authored by 任国军's avatar 任国军

fix token bug

parent 1a724cc1
Pipeline #22615 passed with stage
in 12 seconds
...@@ -51,17 +51,16 @@ class WechatService extends Service { ...@@ -51,17 +51,16 @@ class WechatService extends Service {
if (!flag) { if (!flag) {
this.ctx.set('content-type', 'text/xml'); this.ctx.set('content-type', 'text/xml');
let xml = { const xml = `<xml>
MsgType: 'transfer_customer_service', <ToUserName><![CDATA[${data.FromUserName}]]></ToUserName>
ToUserName: data.FromUserName, <FromUserName><![CDATA[${data.ToUserName}]]></FromUserName>
FromUserName: data.ToUserName, <CreateTime>${parseInt(new Date() / 1000)}</CreateTime>
CreateTime: parseInt(new Date() / 1000), <MsgType><![CDATA[transfer_customer_service]]></MsgType>
}; </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));
} }
return; // return;
} }
async sendText(data) { async sendText(data) {
......
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