Commit 3f221ecc authored by lee_mingzhu's avatar lee_mingzhu

添加判断用户是否绑定的逻辑

parent 7b0ca9ff
...@@ -437,11 +437,15 @@ public class UserController implements IBaseController { ...@@ -437,11 +437,15 @@ public class UserController implements IBaseController {
User user = getCurrentUser(); User user = getCurrentUser();
Long userId = user.getId(); Long userId = user.getId();
LOGGER.info("关联用户:当前登录用户id:" + userId); LOGGER.info("关联用户:当前登录用户id:" + userId);
WechatUserInfo userInfo = wechatService.findWechatUserInfoFromDb(openId); String phoneNo = user.getPhoneNo();
LOGGER.info("关联用户:查询微信用户信息:start"); if(userService.findByPhoneInDb(phoneNo) != null) {
if (userInfo != null && userInfo.getUserId() == null) { return JsonResult.buildErrorStateResult("该手机号已经关联了其他微信账号.", null);
LOGGER.info("关联用户:查询到了微信用户信息."); }
userInfo.setUserId(userId); WechatUserInfo userInfo = wechatService.findWechatUserInfoFromDb(openId);
LOGGER.info("关联用户:查询微信用户信息:start");
if (userInfo != null && userInfo.getUserId() == null) {
LOGGER.info("关联用户:查询到了微信用户信息.");
userInfo.setUserId(userId);
wechatService.saveWechatUserInfo(userInfo); wechatService.saveWechatUserInfo(userInfo);
LOGGER.info("关联用户:关联xyqb用户成功."); LOGGER.info("关联用户:关联xyqb用户成功.");
} }
......
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