diff --git a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java index 9fcc5d9..51c24a0 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java +++ b/luoo_user/src/main/java/com/luoo/user/service/UserInfoService.java @@ -282,18 +282,7 @@ public class UserInfoService { + jwtUtil.createJWT(userInfo.getId(), userInfo.getNickName(), Constants.TOKEN_ROLE_APP_USER, userInfo.getAvatar()); } - public Result setPhoneNumber(String userid, String phoneNumber){ - UserInfo userbyId = userInfoDao.getById(userid); - if(userbyId == null) - return Result.failed(StatusCode.USER_INVALID_USER_ID); - userbyId.setMobile(phoneNumber); - UserInfo save = userInfoDao.save(userbyId); - - if(save != null) - return Result.success(); - return Result.failed(); - } public List orderByField(List idList) { return userInfoDao.orderByField(idList); diff --git a/luoo_user/src/main/java/com/luoo/user/service/WeChatAouth2Service.java b/luoo_user/src/main/java/com/luoo/user/service/WeChatAouth2Service.java index c70399c..adc5268 100644 --- a/luoo_user/src/main/java/com/luoo/user/service/WeChatAouth2Service.java +++ b/luoo_user/src/main/java/com/luoo/user/service/WeChatAouth2Service.java @@ -87,7 +87,14 @@ public class WeChatAouth2Service { public Result bindPhoneNumber(UserLoginDto user, WeChatBindReq weChatBindReq){ - return userInfoService.setPhoneNumber(user.getUserId(),weChatBindReq.getMobile()); + UserInfo userbyId = userInfoService.findById(user.getUserId()); + if(userbyId == null) + return Result.failed(StatusCode.USER_INVALID_USER_ID); + userbyId.setMobile(weChatBindReq.getMobile()); + + userInfoService.bindMobile(userbyId); + + return Result.success(); } public Aouth2WeChatTokenResponse getAccessToken(String code){