第三方平台APPID:wx753dec49c48fab55
代码如下
public String msgCallBack(String appId, HttpServletRequest request, String msg_signature, String timestamp, String nonce, String signature) throws Exception {
System.out.println(appId);
System.out.println("参数数组" + JsonUtil.obj2String(request.getParameterMap()));
String postData = HttpUtil.httpRequest2String(request);
System.out.println("post" + postData);
WXBizMsgCrypt pc = new WXBizMsgCrypt(token, encodingAesKey, appId);
// 第三方收到公众号平台发送的消息
try {
System.out.println("msg_signture" + msg_signature + "\ntimestamp" + timestamp + "\nnonce" + nonce + "\npostdata" + postData);
String result2 = pc.decryptMsg(msg_signature, timestamp, nonce, postData);
System.out.println("解密后明文: " + result2);
} catch (Exception e) {
System.out.println(e.toString());
}
return "success";
}
参数都已经按照要求进行传参,消息解密就不对
本地验证的签名5e51248410a6f9510782f3f14d60d3409afcdc33 网络实际签名9e0a81c26a9a6b62cb077e24bb5486884df0a413
你好,
出现了502错误码,麻烦自查一下。另外,接收授权事件URL需要返回success字符串哈,后续遇到ticket类问题可参考排错指南https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/api/component_verify_ticket_troubleshooting.html自助排查哈