public static String getUserOpenId(String accessToken){ String result = null; String requestUrl ="https://api.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN"; requestUrl = requestUrl.replace("ACCESS_TOKEN", accessToken); JSONObject jsonObject = WeixinUtil.httpRequest(requestUrl, "GET", null); if(null != jsonObject){ System.out.println(jsonObject); System.out.println(jsonObject.get("total")); System.out.println(jsonObject.get("data")); result = jsonObject.get("data")+""; } return result; }
时间: 2024-09-27 11:10:45