Open 1137525818 opened 1 month ago
能否贴一下本地的日志呢?
回调处理地址就直接返回 public ResponseEntity post(final String appid, final HttpServletRequest request, final String requestBody) { return ResponseEntity.ok(""); }
// 事件处理, 直接就WxMpXmlOutMessage返回null,我是异步发送的客服消息 public class MenuHandler extends AbstractHandler { @Override public WxMpXmlOutMessage handle(final WxMpXmlMessage wxMessage, final Map<String, Object> context, final WxMpService wxMpService, final WxSessionManager sessionManager) { String appId = getAppId(context); String eventKey = wxMessage.getEventKey(); log.info("MenuHandler菜单事件, appId: {}, eventKey: {}", appId, eventKey); if (StringUtils.isNotEmpty(wxMessage.getEventKey())) { // 发送客服消息 wxMpService.getKefuService().sendKefuMessage() } return null; } }
按照此文档,需要返回return ResponseEntity.ok("");
,麻烦尝试修改后进行测试
其次建议异步调用客服消息,否则可能因为调用客服消息响应时间过长导致公众号无法及时收到相应
WxMpMessageHandler 我返回的都是 null,都是异步处理 只是WxMpMessageInterceptor这个没有实现, (这个有影响吗) WxMpMessageHandler不同事件类型也发送消息了,就是接收到消息后,还有一个 该公众号提供服务出现故障,请稍后重试 信息
提问前,请确保阅读过项目首页说明以及wiki开发文档相关内容,尤其是常见问题部分。完成内容后,请务必移除包括本句在内的无用内容,以免影响阅读,否则直接关闭,谢谢合作~
另外如果确认属于bug,而且已明确如何修复,请参考贡献指南直接提交PR,省的浪费时间在这里描述问题,非常感谢配合
简要描述
对接公众号品台能力,自动回复总是出现 提供服务故障
模块版本情况
详细描述
回调代码 public ResponseEntity
" timestamp=[{}], nonce=[{}], requestBody=[{}] ", appid, openid, signature, encType, msgSignature, timestamp, nonce, requestBody);
if (!this.wxMpService.switchover(appid)) { throw new IllegalArgumentException(String.format("未找到对应appid=[%s]的配置,请核实!", appid)); }
if (!wxMpService.checkSignature(timestamp, nonce, signature)) { throw new IllegalArgumentException("非法请求,可能属于伪造的请求!"); } // 这里异步发送客服消息 return ResponseEntity.ok(""); }
配置信息
public WxMpMessageRouter messageRouter(final WxMpService wxMpService) { final WxMpMessageRouter newRouter = new WxMpMessageRouter(wxMpService);
}