Merge branch 'dev/dev_xp' into dev/dev

This commit is contained in:
2024-12-23 17:31:53 +08:00
2 changed files with 10 additions and 3 deletions

View File

@@ -236,6 +236,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
private void validateUserValidaExpire(Account account) {
Long currentTime = new Date().getTime();
if (account.getSystemUser().equals(0)){
return;
}
if (Objects.nonNull(account.getValidStartTime())) {
if (currentTime < account.getValidStartTime()) {
throw new BusinessException("user.expired");
@@ -243,7 +246,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
}
if (Objects.nonNull(account.getValidEndTime())) {
if (currentTime > account.getValidEndTime()) {
throw new BusinessException("user.expired");
toVisitor(account);
return;
// throw new BusinessException("user.expired");
}
}
}
@@ -1499,12 +1504,14 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
// 将新增用户添加到AiDA身份为游客
if (!newUsersInfo.isEmpty()){
newUsersInfo.forEach(userInfo -> {
long epochMilli = Instant.now().toEpochMilli();
Account account = new Account();
account.setUserEmail(userInfo.get("email"));
account.setUserName(userInfo.get("username"));
account.setUserPassword("Third-000000");
account.setLanguage(Language.ENGLISH.name());
account.setValidStartTime(Instant.now().toEpochMilli());
account.setValidStartTime(epochMilli);
account.setValidEndTime(epochMilli);
account.setCreateDate(new Date());
account.setIsTrial(0);
account.setIsBeginner(1);

View File

@@ -25,7 +25,7 @@
</select>
<update id="toVisitor">
update t_account
set valid_end_time = null, is_trial = 0, credits = 0, system_user = 0, update_date = #{date}
set is_trial = 0, credits = 0, system_user = 0, update_date = #{date}
where id = #{id}
</update>