|
@@ -1,48 +1,30 @@
|
|
|
-/*
|
|
|
+
|
|
|
package com.fire.admin.util;
|
|
|
|
|
|
+import ch.qos.logback.core.util.COWArrayList;
|
|
|
import com.fire.dto.system.SysOperatingator;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.aopalliance.intercept.Joinpoint;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.context.ApplicationContext;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-import org.aspectj.lang.annotation.*;
|
|
|
-import org.springframework.web.context.request.RequestContextHolder;
|
|
|
-import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.time.Instant;
|
|
|
-import java.util.Objects;
|
|
|
-
|
|
|
-*/
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* @author: liuliu
|
|
|
* @ClassName: SysOperatingAspect
|
|
|
* @Description: TODO
|
|
|
* @date: 2021-05-18 11:51
|
|
|
- *//*
|
|
|
+ */
|
|
|
|
|
|
-@Slf4j
|
|
|
-@Aspect
|
|
|
-@Component
|
|
|
-public class SysOperatingAspect {
|
|
|
|
|
|
- private ThreadLocal<SysOperatingator> sysOperatingator = new ThreadLocal<>();
|
|
|
+public class SysOperatingAspect {
|
|
|
|
|
|
|
|
|
- @Pointcut("execution(public * com.fire.admin.rest..*.*(..))")
|
|
|
- public void webLog(){}
|
|
|
+ private static ThreadLocal<SysOperatingator> sysOperatingator = new ThreadLocal<>();
|
|
|
|
|
|
- @Before(value = "sysOperatingAspect()")
|
|
|
- public String beforeGetOperatingator(Joinpoint joinpoint) throws Throwable {
|
|
|
+ public static String getLoginUser() {
|
|
|
SysOperatingator ator = new SysOperatingator();
|
|
|
sysOperatingator.set(ator);
|
|
|
- HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
|
|
|
PreSecurityUser securityUser = SecurityUtil.getUser();
|
|
|
ator.setCreator(securityUser.getUsername());
|
|
|
return ator.getCreator();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
-*/
|
|
|
+
|