Pre Merge pull request !84 from 杨柳清风/master

pull/84/MERGE
杨柳清风 2024-10-23 07:54:39 +00:00 committed by Gitee
commit f9738c5ee4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 7 additions and 1 deletions

View File

@ -89,7 +89,13 @@ public class IdentityProviderAuthenticationServiceImpl implements
@Transactional(rollbackFor = Exception.class)
public Boolean bindUserIdp(String accountId,
IdentityProviderUserDetails identityProviderUserDetails) {
// 查询是否已绑定其他账号
// 查询用户账号是否已经绑定
Optional<UserIdpBindPO> userIdpBindEntity = userIdpRepository.findByIdpIdAndUserId(identityProviderUserDetails.getProviderId(), accountId);
if (userIdpBindEntity.isPresent()) {
throw new UserBindIdentityProviderException("该账户已被其他三方账号绑定,解绑后可重新绑定",
HttpStatus.INTERNAL_SERVER_ERROR);
}
// 查询idp账号是否已绑定其他账号
Optional<ThirdPartyUserEntity> thirdPartyUserEntity = this.thirdPartyUserRepository
.findByOpenIdAndIdpId(identityProviderUserDetails.getOpenId(),
identityProviderUserDetails.getProviderId());