|
@@ -2,6 +2,8 @@ package com.dragoninfo.dcuc.auth.business.impl.zerotrust;
|
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.dragoninfo.dcuc.auth.audit.dto.TokenOperationDto;
|
|
|
+import com.dragoninfo.dcuc.auth.audit.service.log.QmAuditPushService;
|
|
|
import com.dragoninfo.dcuc.auth.auth.dto.AppAuthResultDto;
|
|
|
import com.dragoninfo.dcuc.auth.business.ICacheBusiness;
|
|
|
import com.dragoninfo.dcuc.auth.constance.ZerotrustAuthRedisConstant;
|
|
@@ -13,6 +15,7 @@ import com.dragonsoft.duceap.base.enums.BooleanEnum;
|
|
|
import com.dragonsoft.duceap.base.exception.ApplicationException;
|
|
|
import com.dragonsoft.duceap.commons.util.collections.CollectionUtils;
|
|
|
import com.dragonsoft.duceap.commons.util.string.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -44,6 +47,9 @@ public class RedisCacheBusinessImpl implements ICacheBusiness {
|
|
|
@Resource
|
|
|
private StringRedisTemplate stringRedisTemplate;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private QmAuditPushService qmAuditPushService;
|
|
|
+
|
|
|
private void cacheUserToken(UserTokenInfoRespVO userToken) {
|
|
|
// 缓存人员令牌
|
|
|
long tokenExpireTime = userToken.getExpireAt().getTime();
|
|
@@ -214,6 +220,14 @@ public class RedisCacheBusinessImpl implements ICacheBusiness {
|
|
|
} else if (TokenActionEnum.RENEW.getValue().equals(action)) {
|
|
|
renewAppToken(tokenInfo);
|
|
|
}
|
|
|
+ TokenOperationDto dto = TokenOperationDto.builder()
|
|
|
+ .action(action)
|
|
|
+ .operateTime(new Date())
|
|
|
+ .pid(tokenInfo.getUserToken().getPid())
|
|
|
+ .tokenType(TokenTypeEnum.USER.getValue())
|
|
|
+ .build();
|
|
|
+ // 发送令牌处理日志
|
|
|
+ qmAuditPushService.pushTokenReceiveLog(Collections.singletonList(dto));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -228,6 +242,14 @@ public class RedisCacheBusinessImpl implements ICacheBusiness {
|
|
|
} else if (TokenActionEnum.RENEW.getValue().equals(action)) {
|
|
|
renewUserToken(tokenInfo);
|
|
|
}
|
|
|
+ TokenOperationDto dto = TokenOperationDto.builder()
|
|
|
+ .action(action)
|
|
|
+ .operateTime(new Date())
|
|
|
+ .pid(tokenInfo.getPid())
|
|
|
+ .tokenType(TokenTypeEnum.USER.getValue())
|
|
|
+ .build();
|
|
|
+ // 发送令牌处理日志
|
|
|
+ qmAuditPushService.pushTokenReceiveLog(Collections.singletonList(dto));
|
|
|
}
|
|
|
|
|
|
|