Commit f49a1289 authored by shiyu's avatar shiyu

公众号

parent ea33be02
...@@ -88,8 +88,9 @@ public class OfficialAccountController { ...@@ -88,8 +88,9 @@ public class OfficialAccountController {
@RequestParam(required = false, name = "timestamp") String timestamp, @RequestParam(required = false, name = "timestamp") String timestamp,
@RequestParam(required = false, name = "nonce") String nonce, @RequestParam(required = false, name = "nonce") String nonce,
@RequestParam(required = false, name = "echostr") String echostr, @RequestParam(required = false, name = "echostr") String echostr,
@RequestBody(required = false) String xmlInfo) { @RequestBody(required = false) String xmlInfo,
logger.info("222222222222222"); HttpServletResponse response) throws IOException {
logger.info("222222222222222 :{}", echostr);
try { try {
logger.info("微信通知回调接口原文:{}", xmlInfo); logger.info("微信通知回调接口原文:{}", xmlInfo);
List<Map<String, String>> list = XmlUtils.fromXml(xmlInfo, "xml"); List<Map<String, String>> list = XmlUtils.fromXml(xmlInfo, "xml");
...@@ -104,6 +105,9 @@ public class OfficialAccountController { ...@@ -104,6 +105,9 @@ public class OfficialAccountController {
} catch (Exception e) { } catch (Exception e) {
logger.error("视频号回调推送error : {}", e); logger.error("视频号回调推送error : {}", e);
} }
response.setContentType("text/plain"); // 设置响应的内容类型为HTML
response.setCharacterEncoding("UTF-8"); // 设置响应的字符编码为UTF-8
response.getWriter().write(echostr);
return echostr; return echostr;
} }
......
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