|
|
@@ -105,16 +105,15 @@ public class WxLoginService
|
|
|
}
|
|
|
|
|
|
public String getWxUnionId(WxLoginBody loginBody) {
|
|
|
- String url = String.format(wxAuthParam, appid, appsrcret, loginBody.getCode());
|
|
|
-
|
|
|
- String resultString = HttpUtils.sendGet(wxAuthUrl,wxAuthParam);
|
|
|
+ String param = String.format(wxAuthParam, appid, appsrcret, loginBody.getCode());
|
|
|
+ String resultString = HttpUtils.sendGet(wxAuthUrl,param);
|
|
|
//解析json
|
|
|
JSONObject jsonObject1 = (JSONObject) JSONObject.parse(resultString);
|
|
|
String session_key = jsonObject1.get("session_key")+"";
|
|
|
String openid = jsonObject1.get("openid")+"";
|
|
|
// WxLoginResultBo wxLoginResult = restTemplate.getForObject(url, WxLoginResultBo.class);
|
|
|
String wxResult = obtainWxPhone(loginBody.getIv(),loginBody.getEncryptedData(),session_key);
|
|
|
- return wxAuthUrl+"@@"+wxAuthParam;
|
|
|
+ return resultString;
|
|
|
}
|
|
|
|
|
|
public String obtainWxPhone(String iv, String encryptedData,String session_key){
|