TASK:AiDA
This commit is contained in:
@@ -384,7 +384,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
if (Objects.isNull(authenticationOperationTypeEnum)) {
|
||||
throw new BusinessException("unknown.authentication.operation.type");
|
||||
}
|
||||
Account emailAccount = getOneByEmail(emailSendDTO.getEmail());
|
||||
// Account emailAccount = getOneByEmail(emailSendDTO.getEmail());
|
||||
String randomVerifyCode = RandomsUtil.generateVerifyCode(100000L, 999999L);
|
||||
LocalCacheUtils.setVerifyCodeCache(
|
||||
emailSendDTO.getOperationType() + "_" + emailSendDTO.getEmail(), randomVerifyCode);
|
||||
@@ -403,6 +403,12 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
SendEmailUtil.EXCEPTION_ID_TEMPLATE_ID, randomVerifyCode);
|
||||
break;
|
||||
case BIND_MAILBOX:
|
||||
QueryWrapper<Account> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(Account::getUserEmail, emailSendDTO.getEmail());
|
||||
List<Account> accounts = accountMapper.selectList(qw);
|
||||
if (CollectionUtil.isNotEmpty(accounts)) {
|
||||
throw new BusinessException("This email has been bound");
|
||||
}
|
||||
result = SendEmailUtil.send(emailSendDTO.getEmail(), null,
|
||||
SendEmailUtil.BIND_MAILBOX_TEMPLATE_ID, randomVerifyCode);
|
||||
break;
|
||||
@@ -2468,6 +2474,14 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
String name = (String) payload.get("name");
|
||||
String pictureUrl = (String) payload.get("picture");
|
||||
|
||||
QueryWrapper<AccountExtend> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(AccountExtend::getAuth, userId);
|
||||
qw.lambda().eq(AccountExtend::getAuthType, "Google");
|
||||
List<AccountExtend> accountExtends = accountExtendMapper.selectList(qw);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(accountExtends)) {
|
||||
throw new BusinessException("The Google has been bound.");
|
||||
}
|
||||
|
||||
AccountExtend accountExtendInsert = new AccountExtend();
|
||||
accountExtendInsert.setAuth(userId);
|
||||
@@ -2512,6 +2526,15 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
||||
if (unionId == null) {
|
||||
throw new IllegalArgumentException("无法获取 unionid,请检查微信开发平台配置");
|
||||
}
|
||||
QueryWrapper<AccountExtend> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(AccountExtend::getAuth, unionId);
|
||||
qw.lambda().eq(AccountExtend::getAuthType, "WeChat");
|
||||
List<AccountExtend> accountExtends = accountExtendMapper.selectList(qw);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(accountExtends)) {
|
||||
throw new BusinessException("The WeChat has been bound.");
|
||||
}
|
||||
|
||||
AccountExtend accountExtendInsert = new AccountExtend();
|
||||
accountExtendInsert.setAuth(unionId);
|
||||
accountExtendInsert.setAuthType("WeChat");
|
||||
|
||||
Reference in New Issue
Block a user