Commit 44df3597 authored by 任国军's avatar 任国军

wechat check

parent ccefb799
Pipeline #24421 passed with stage
in 5 seconds
...@@ -95,27 +95,8 @@ class WechatController extends Controller { ...@@ -95,27 +95,8 @@ class WechatController extends Controller {
xmlData += '</xml>'; xmlData += '</xml>';
ctx.body = xmlData; ctx.body = xmlData;
let data = ''; ctx.logger.info(ctx.req.xml);
ctx.req.setEncoding('utf8'); ctx.logger.info(ctx.request.body);
ctx.req.on('data', function(chunk) {
data += chunk;
});
const getxml = await new Promise(function(resolve) {
ctx.req.on('end', function() {
resolve(data);
});
});
const parseObj = await new Promise(function(resolve) {
xml2js(getxml, {
explicitArray: false,
}, function(err, json) {
resolve(json);
});
});
ctx.logger.info(parseObj);
ctx.logger.info(ctx.req);
ctx.logger.info(ctx.request);
return ctx.body; return ctx.body;
} }
} }
......
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