|
|
@ -324,7 +324,6 @@ public class LoginController { |
|
|
|
**/ |
|
|
|
**/ |
|
|
|
private Integer dealBindYyyfAccount(String userId, String tel, HttpServletRequest request) { |
|
|
|
private Integer dealBindYyyfAccount(String userId, String tel, HttpServletRequest request) { |
|
|
|
Integer yyyfUserId = null; |
|
|
|
Integer yyyfUserId = null; |
|
|
|
String yyyfTtoken = request.getHeader(BaseConstant.YYYF_TOKEN_HEADER); |
|
|
|
|
|
|
|
YyyfUserDto yyyfUserDto = YyyfUserDtoUtils.getYyyfUserDto(request, redisTemplate); |
|
|
|
YyyfUserDto yyyfUserDto = YyyfUserDtoUtils.getYyyfUserDto(request, redisTemplate); |
|
|
|
//如果有token,拿到用户信息,与以渔有方进行绑定
|
|
|
|
//如果有token,拿到用户信息,与以渔有方进行绑定
|
|
|
|
if (yyyfUserDto != null) { |
|
|
|
if (yyyfUserDto != null) { |
|
|
@ -332,12 +331,14 @@ public class LoginController { |
|
|
|
YyyfUser yyyfUser = this.yyyfUserService.selectByYyyfUserIdAndTel(yyyfUserId, tel); |
|
|
|
YyyfUser yyyfUser = this.yyyfUserService.selectByYyyfUserIdAndTel(yyyfUserId, tel); |
|
|
|
if (yyyfUser == null) { |
|
|
|
if (yyyfUser == null) { |
|
|
|
this.yyyfUserService.saveUser(yyyfUserId, userId, yyyfUserDto.getUserName()); |
|
|
|
this.yyyfUserService.saveUser(yyyfUserId, userId, yyyfUserDto.getUserName()); |
|
|
|
this.redisTemplate.delete(yyyfTtoken); |
|
|
|
// this.redisTemplate.delete(yyyfTtoken);
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (!yyyfUser.getUserId().equals(userId)) { |
|
|
|
if (!yyyfUser.getUserId().equals(userId)) { |
|
|
|
throw new UserException(UserEnums.USER_NOT_FORBID_OTHER_USER); |
|
|
|
throw new UserException(UserEnums.USER_NOT_FORBID_OTHER_USER); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//通过当前用户id与以渔有方用户关联
|
|
|
|
|
|
|
|
redisTemplate.opsForValue().set(BaseConstant.USER_ID_YYYF_USER_KEY.concat(userId),yyyfUserDto); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new UserException(UserEnums.USER_NOT_BIND_YYYF); |
|
|
|
throw new UserException(UserEnums.USER_NOT_BIND_YYYF); |
|
|
|
} |
|
|
|
} |
|
|
|