From b4c3910d7a65fcf24eecfe08a7d9f6b48ac3a0bd Mon Sep 17 00:00:00 2001 From: Stormeye Wu Date: Mon, 3 Dec 2018 10:42:57 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=8E=A5=E6=94=B6=E5=BE=AE=E4=BF=A1=E5=9B=9E?= =?UTF-8?q?=E8=B0=83][=E4=BF=AE=E6=94=B9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WechatCalllbackController.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WechatCalllbackController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WechatCalllbackController.java index aa0694fa1..092f984e5 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WechatCalllbackController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WechatCalllbackController.java @@ -25,15 +25,10 @@ public class WechatCalllbackController extends BaseController { protected WxOpenService wxOpenService; @RequestMapping("/notify") - public Object receiveTicket(HttpServletRequest request) throws IOException { - logger.info("[" +getIpAddr() + "]接收微信请求"); - InputStream inStream = request.getInputStream(); - byte[] buffer = new byte[1024]; - int len = 0; - while ((len = inStream.read(buffer)) != -1) { - logger.debug(buffer.toString()); - } - /* + public Object receiveTicket(@RequestBody(required = false) String requestBody, @RequestParam("timestamp") String timestamp, + @RequestParam("nonce") String nonce, @RequestParam("signature") String signature, + @RequestParam(name = "encrypt_type", required = false) String encType, + @RequestParam(name = "msg_signature", required = false) String msgSignature) { logger.info( "\n接收微信请求:[signature=[{}], encType=[{}], msgSignature=[{}]," + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", @@ -54,12 +49,11 @@ public class WechatCalllbackController extends BaseController { } catch (WxErrorException e) { this.logger.error("notify", e); } - */ return "success"; } - @RequestMapping("callback/{appId}") + @RequestMapping("/{appId}/callback") public Object callback(@RequestBody(required = false) String requestBody, @PathVariable("appId") String appId, @RequestParam("signature") String signature,