游客到试用用户身份转换
This commit is contained in:
@@ -508,7 +508,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
QueryWrapper<Account> qw = new QueryWrapper<>();
|
QueryWrapper<Account> qw = new QueryWrapper<>();
|
||||||
qw.eq("BINARY user_email", accountTrialDTO.getEmail());
|
qw.eq("BINARY user_email", accountTrialDTO.getEmail());
|
||||||
List<Account> accountList = accountMapper.selectList(qw);
|
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) {
|
if (accountList.get(0).getIsTrial() == 1) {
|
||||||
throw new BusinessException("The email has already been registered", ResultEnum.PROMPT.getCode());
|
throw new BusinessException("The email has already been registered", ResultEnum.PROMPT.getCode());
|
||||||
} else {
|
} else {
|
||||||
@@ -538,6 +538,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
|
|||||||
account = CopyUtil.copyObject(accountList.get(0), Account.class);
|
account = CopyUtil.copyObject(accountList.get(0), Account.class);
|
||||||
account.setIsTrial(1);
|
account.setIsTrial(1);
|
||||||
account.setIsBeginner(1);
|
account.setIsBeginner(1);
|
||||||
|
account.setSystemUser(3);
|
||||||
account.setValidStartTime(System.currentTimeMillis());
|
account.setValidStartTime(System.currentTimeMillis());
|
||||||
if (link) {
|
if (link) {
|
||||||
account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());
|
account.setValidEndTime(Instant.now().plus(14, ChronoUnit.DAYS).toEpochMilli());
|
||||||
|
|||||||
Reference in New Issue
Block a user