|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.aliyun.oss.HttpMethod;
|
|
|
import com.winsea.svc.base.security.entity.User;
|
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.CommonUser;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.HyOperLog;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.IHyOperLogService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -12,6 +13,7 @@ import org.aspectj.lang.JoinPoint;
|
|
|
import org.aspectj.lang.annotation.AfterReturning;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -39,6 +41,8 @@ public class LogAspect {
|
|
|
@Autowired
|
|
|
private IHyOperLogService operLogService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StringRedisTemplate userRedisTemplate;
|
|
|
/**
|
|
|
* 处理完请求后执行
|
|
|
* @param joinPoint 切点
|
|
@@ -60,6 +64,12 @@ public class LogAspect {
|
|
|
operLog.setCreateUserId(accountId);
|
|
|
}
|
|
|
}
|
|
|
+ else{
|
|
|
+ CommonUser commonUser = JSONObject.parseObject(userRedisTemplate.opsForValue().get(Const.USER_REDIS_PREFIX + ServletUtils.getRequest().getHeader("accessToken")),CommonUser.class);
|
|
|
+ if(commonUser != null){
|
|
|
+ operLog.setCreateUserId(commonUser.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
operLog.setStatus("成功");
|
|
|
// 请求的IP地址
|
|
|
String iP = ServletUtil.getClientIP(ServletUtils.getRequest());
|