|
|
@@ -287,9 +287,9 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
if (afterExpiryTime == null) {
|
|
|
afterExpiryTime = groupsAccountView.getExpiryTime();
|
|
|
}
|
|
|
-
|
|
|
+ log.info("原账号accountId:{}", accountId);
|
|
|
//替换账号
|
|
|
- accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
|
|
|
+ int update = accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
|
|
|
.set(Account::getAccount, account)
|
|
|
.set(Account::getPassword, password)
|
|
|
.set(Account::getRemark, remark)
|
|
|
@@ -297,6 +297,11 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
.set(Account::getExpiryTime, afterExpiryTime)
|
|
|
.set(Account::getGptRefreshToken, StrUtil.EMPTY)
|
|
|
.eq(Account::getId, accountId));
|
|
|
+ if (update == 0) {
|
|
|
+ log.info("替换原账号oldAccount:{}至新账号newAccount:{}失败", groupsAccountView.getAccount(), account);
|
|
|
+ throw BusinessRuntimeException.getInstance("替换账号失败");
|
|
|
+ }
|
|
|
+
|
|
|
if (StrUtil.isNotBlank(groupsAccountView.getGptRefreshToken())) {
|
|
|
//清除gpt token
|
|
|
redisService.del(RedisKey.CHATGPT_ACCESS_TOKEN + groupsAccountView.getAccount());
|