Commit d903c122 authored by shiyu's avatar shiyu

获取登录用户手机号

parent 414a5b59
...@@ -37,8 +37,11 @@ import com.wwdz.ch.wx.util.IpUtil; ...@@ -37,8 +37,11 @@ import com.wwdz.ch.wx.util.IpUtil;
import com.wwdz.ch.wx.util.RedisUtil; import com.wwdz.ch.wx.util.RedisUtil;
import com.wwdz.ch.wx.util.StringUtil; import com.wwdz.ch.wx.util.StringUtil;
import com.wwdz.ch.wx.util.WxResponseCode; import com.wwdz.ch.wx.util.WxResponseCode;
import com.wwdz.mall.common.vo.response.CloudServerResponse;
import com.wwdz.user.api.service.user.UserReadService; import com.wwdz.user.api.service.user.UserReadService;
import com.wwdz.user.api.service.user.UserWriteService;
import com.xxdxxs.utils.JsonUtils; import com.xxdxxs.utils.JsonUtils;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -119,6 +122,9 @@ public class UserServiceImpl implements UserService { ...@@ -119,6 +122,9 @@ public class UserServiceImpl implements UserService {
@Autowired @Autowired
AiAssistantDao aiAssistantDao; AiAssistantDao aiAssistantDao;
@Reference
UserWriteService userWriteService;
...@@ -217,8 +223,19 @@ public class UserServiceImpl implements UserService { ...@@ -217,8 +223,19 @@ public class UserServiceImpl implements UserService {
if (dto.getLoginType().equals(LoginTypeEnum.WECHAT.getCode())) { if (dto.getLoginType().equals(LoginTypeEnum.WECHAT.getCode())) {
phone = wxLoginManager.getPhone(dto); phone = wxLoginManager.getPhone(dto);
if (StringUtils.equals("phoneFalse", phone)) { if (StringUtils.equals("phoneFalse", phone)) {
logger.info(">>>>>>>>>>>>>FAILED 获取手机号失败 <<<<<<<<<<<<<"); logger.info(">>>>>>>>>>>>> FAILED 获取手机号失败 <<<<<<<<<<<<<");
phone = null; phone = null;
} else {
//保存用户手机
com.wwdz.user.api.model.user.User wuser = new com.wwdz.user.api.model.user.User();
wuser.setUserId(dto.getUserId());
wuser.setPhone(phone);
CloudServerResponse<Integer> cloudServerResponse = userWriteService.updateByUserId(wuser);
if (cloudServerResponse.getResult() != null && cloudServerResponse.getResult() > 0) {
logger.info(">>>>>>>> 用户id:{} 保存用户手机号成功 <<<<<<<<", dto.getUserId());
} else {
logger.error(">>>>>>>> 用户id:{} 保存用户手机号失败 <<<<<<<<", dto.getUserId());
}
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment