小程序
小游戏
企业微信
微信支付
扫描小程序码分享
不知错在哪里?还是我设置的位置不对?
以下是我对自己的URL验证结果
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
我记得post要返回一个“success”
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
服务端代码:
@GetMapping("/wechat/receive") public ResponseEntity check(@RequestParam String signature, @RequestParam String echostr, @RequestParam String timestamp, @RequestParam String nonce) throws AesException { log.info("GET 收到通知, signature:{} echostr:{},timestamp:{},nonce:{} ", signature, echostr, timestamp, nonce); List<String> list = new ArrayList<>(); list.add(echostr); list.add(timestamp); list.add(nonce); wxUserService.checkReceive(signature, echostr, timestamp, nonce, ""); return ResponseEntity.ok(echostr); } @PostMapping("/wechat/receive") public ResponseEntity<String> receiveEvent(@RequestBody WxEncryptEvent wxEncryptEvent, @RequestParam String signature, @RequestParam String echostr, @RequestParam String timestamp, @RequestParam String nonce, @RequestParam String openid, @RequestParam String encrypt_type, @RequestParam String msg_signature) { log.info("收到通知body:{} echostr:{} timestamp:{} nonce:{} openid:{} encrypt_type:{} msg_signature:{}", wxEncryptEvent, echostr, timestamp, nonce, openid, encrypt_type, msg_signature); try { wxUserService.receiveEvent(wxEncryptEvent, echostr, timestamp, nonce, openid, encrypt_type, msg_signature); return ResponseEntity.ok(""); }catch (Exception e){ log.error("", e); } return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(""); }
@Data public class WxEncryptEvent { String ToUserName; String Encrypt; }
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
我记得post要返回一个“success”
服务端代码:
@GetMapping("/wechat/receive") public ResponseEntity check(@RequestParam String signature, @RequestParam String echostr, @RequestParam String timestamp, @RequestParam String nonce) throws AesException { log.info("GET 收到通知, signature:{} echostr:{},timestamp:{},nonce:{} ", signature, echostr, timestamp, nonce); List<String> list = new ArrayList<>(); list.add(echostr); list.add(timestamp); list.add(nonce); wxUserService.checkReceive(signature, echostr, timestamp, nonce, ""); return ResponseEntity.ok(echostr); } @PostMapping("/wechat/receive") public ResponseEntity<String> receiveEvent(@RequestBody WxEncryptEvent wxEncryptEvent, @RequestParam String signature, @RequestParam String echostr, @RequestParam String timestamp, @RequestParam String nonce, @RequestParam String openid, @RequestParam String encrypt_type, @RequestParam String msg_signature) { log.info("收到通知body:{} echostr:{} timestamp:{} nonce:{} openid:{} encrypt_type:{} msg_signature:{}", wxEncryptEvent, echostr, timestamp, nonce, openid, encrypt_type, msg_signature); try { wxUserService.receiveEvent(wxEncryptEvent, echostr, timestamp, nonce, openid, encrypt_type, msg_signature); return ResponseEntity.ok(""); }catch (Exception e){ log.error("", e); } return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(""); }
@Data public class WxEncryptEvent { String ToUserName; String Encrypt; }