|
@@ -43,8 +43,9 @@ public class WxUserServiceImpl extends ServiceImpl<IWxUserMapper, WxUser> implem
|
|
|
|
|
|
@Override
|
|
|
public Object wxLogin(String code) {
|
|
|
+ log.info("wx-wxLogin-code:{}",code);
|
|
|
WxOpenIdVo wxOpenIdVo = wxClient.getOpenIdUrl(WxConfigServiceImpl.wxConfig.getAppId(), WxConfigServiceImpl.wxConfig.getAppSecret(), code);
|
|
|
- log.info("wxLogin-微信获取openid:{}",wxOpenIdVo);
|
|
|
+ log.info("wx-wxLogin-code:{},wxOpenIdVo:{}",code,wxOpenIdVo);
|
|
|
if(wxOpenIdVo.getErrcode() == 0){
|
|
|
WxUser wxUser = this.addUser(wxOpenIdVo);
|
|
|
WxUserVo vo = new WxUserVo();
|
|
@@ -96,7 +97,14 @@ public class WxUserServiceImpl extends ServiceImpl<IWxUserMapper, WxUser> implem
|
|
|
@Override
|
|
|
public Object getPhone(String code) {
|
|
|
try {
|
|
|
- JSONObject jsonObject = wxClient.getPhone(wxService.getToken(), new WxGetPhoneParam(code));
|
|
|
+ log.info("wx-getPhone:code:{}",code);
|
|
|
+ String token = wxService.getToken();
|
|
|
+ log.info("wx-getPhone:token:{},code:{}",token,code);
|
|
|
+ if(StringUtils.isBlank(token)){
|
|
|
+ throw new BusinessException(ResultCode.WX_PHONE_ERROR);
|
|
|
+ }
|
|
|
+ JSONObject jsonObject = wxClient.getPhone(token, new WxGetPhoneParam(code));
|
|
|
+ log.info("wx-getPhone:token:{},code:{},result:{}",token,code,jsonObject);
|
|
|
JSONObject phoneObj = (JSONObject) jsonObject.get("phone_info");
|
|
|
if(phoneObj==null){
|
|
|
throw new BusinessException(ResultCode.WX_PHONE_ERROR);
|