|
|
@@ -1161,16 +1161,18 @@ public class WxLoginService implements IWxLoginService {
|
|
|
initData();
|
|
|
String param = String.format(gzh_wxAuthParam, gzh_appid, gzh_appsrcret, loginBody.getCode());
|
|
|
String resultString = HttpUtils.sendGet(gzh_wxAuthUrl, param);
|
|
|
+ System.out.println(resultString);
|
|
|
//解析json
|
|
|
JSONObject jsonObject = (JSONObject) JSONObject.parse(resultString);
|
|
|
String access_token = String.valueOf(jsonObject.get("access_token"));
|
|
|
- if(Validator.isEmpty(access_token)||access_token.equals("null")){
|
|
|
- throw new CustomException( String.valueOf(jsonObject.get("errmsg ")));
|
|
|
+ if(access_token.equals("null")){
|
|
|
+ throw new CustomException( String.valueOf(jsonObject.get("errmsg")));
|
|
|
}
|
|
|
String openId = String.valueOf(jsonObject.get("openid"));
|
|
|
|
|
|
String userInfoParam = String.format(gzh_wxUserInfoParam, access_token, openId);
|
|
|
String userInfoResultString = HttpUtils.sendGet(gzh_wxUserInfoUrl, userInfoParam);
|
|
|
+ System.out.println(userInfoResultString);
|
|
|
//解析json
|
|
|
JSONObject jsonObject1 = (JSONObject) JSONObject.parse(userInfoResultString);
|
|
|
String unionId = String.valueOf(jsonObject1.get("unionid"));
|