mirror of https://github.com/elunez/eladmin
Merge 8bd547e79d
into f3cdf8ccfc
commit
ee92427964
|
@ -29,6 +29,7 @@ import org.aspectj.lang.annotation.Around;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Pointcut;
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,9 +66,13 @@ public class LogAspect {
|
||||||
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
|
||||||
Object result;
|
Object result;
|
||||||
currentTime.set(System.currentTimeMillis());
|
currentTime.set(System.currentTimeMillis());
|
||||||
|
Log log;
|
||||||
|
try {
|
||||||
result = joinPoint.proceed();
|
result = joinPoint.proceed();
|
||||||
Log log = new Log("INFO",System.currentTimeMillis() - currentTime.get());
|
log = new Log("INFO", System.currentTimeMillis() - currentTime.get());
|
||||||
|
} finally {
|
||||||
currentTime.remove();
|
currentTime.remove();
|
||||||
|
}
|
||||||
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
HttpServletRequest request = RequestHolder.getHttpServletRequest();
|
||||||
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), joinPoint, log);
|
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), joinPoint, log);
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue