提交 e7205576 作者: zhenjie

公众号事件推送修改

上级 ce296875
...@@ -137,7 +137,7 @@ public class WxServiceImpl implements WxService { ...@@ -137,7 +137,7 @@ public class WxServiceImpl implements WxService {
public String receiveSubAccountEvents(HttpServletRequest request) { public String receiveSubAccountEvents(HttpServletRequest request) {
try { try {
Map<String, String> map = this.convertRequestToMap(request); Map<String, String> map = this.convertRequestToMap(request);
log.info("Received wx events(after convert):", JSONObject.toJSONString(map)); log.info("Received wx events(after convert):{}", JSONObject.toJSONString(map));
String event = map.get("Event"); String event = map.get("Event");
if (WxConstant.subscribe.equals(event)) { if (WxConstant.subscribe.equals(event)) {
// 关注事件 // 关注事件
...@@ -191,6 +191,7 @@ public class WxServiceImpl implements WxService { ...@@ -191,6 +191,7 @@ public class WxServiceImpl implements WxService {
+ "&lang=zh_CN"; + "&lang=zh_CN";
//String jsonStr = HttpsOpenUtil.https(InfoUrl, "GET");// 错误:{"errcode":40013,"errmsg":"invalid appid"} //String jsonStr = HttpsOpenUtil.https(InfoUrl, "GET");// 错误:{"errcode":40013,"errmsg":"invalid appid"}
String jsonStr = HttpsRequestUtil.httpsRequest(InfoUrl, "GET", null, null); String jsonStr = HttpsRequestUtil.httpsRequest(InfoUrl, "GET", null, null);
log.info("updateWXUserInfo:{}", jsonStr);
JSONObject obj = JSONObject.parseObject(jsonStr); JSONObject obj = JSONObject.parseObject(jsonStr);
// 用户是否订阅该公众号标识,值为0时,代表此用户没有关注该公众号,拉取不到其余信息。 // 用户是否订阅该公众号标识,值为0时,代表此用户没有关注该公众号,拉取不到其余信息。
Integer subscribe = obj.getInteger("subscribe"); Integer subscribe = obj.getInteger("subscribe");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论