游客到试用用户身份转换

This commit is contained in:
2024-07-15 13:47:43 +08:00
parent 6a098ffa13
commit 9b185e6919

View File

@@ -508,7 +508,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
QueryWrapper<Account> qw = new QueryWrapper<>();
qw.eq("BINARY user_email", accountTrialDTO.getEmail());
List<Account> accountList = accountMapper.selectList(qw);
if (CollectionUtil.isNotEmpty(accountList)) {
if (CollectionUtil.isNotEmpty(accountList) && !accountList.get(0).getSystemUser().equals(0)) {
if (accountList.get(0).getIsTrial() == 1) {
throw new BusinessException("The email has already been registered", ResultEnum.PROMPT.getCode());
} else {
@@ -538,6 +538,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
account = CopyUtil.copyObject(accountList.get(0), Account.class);
account.setIsTrial(1);
account.setIsBeginner(1);
account.setSystemUser(3);
account.setValidStartTime(System.currentTimeMillis());
if (link) {
account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());