|
@@ -168,7 +168,7 @@ public class UserController extends BaseApiController {
|
|
|
appSecret = channelAppSecret;
|
|
|
}
|
|
|
//调用微信后台接口获取openId
|
|
|
- String res = getWxMobile(wxLoginParams, appId, appSecret);
|
|
|
+ String res = getWxMobile(wxLoginParams, appId);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(res);
|
|
|
int errcode = jsonObject.getIntValue("errcode");
|
|
|
if (errcode != 0 ) {
|
|
@@ -275,11 +275,12 @@ public class UserController extends BaseApiController {
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- private String getWxMobile(WxLoginParams params, String appId, String appSecret) {
|
|
|
+ private String getWxMobile(WxLoginParams params, String appId) {
|
|
|
String accessToken = appTokenService.getAccessToken(appId);
|
|
|
- String param = "code=" + params.getCode();
|
|
|
- LogUtil.info(logger, param);
|
|
|
- String res = HttpUtils.sendPost("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + accessToken, param);
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("code", params.getCode());
|
|
|
+ LogUtil.info(logger, JSONObject.toJSONString(params));
|
|
|
+ String res = HttpUtils.sendPost("https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token=" + accessToken, jsonObject.toJSONString());
|
|
|
return res;
|
|
|
}
|
|
|
|