feat: 增加操作日志的操作人和操作时间
This commit is contained in:
parent
c0f460e1e4
commit
16e656d820
@ -21,6 +21,7 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author weihongyang
|
* @Author weihongyang
|
||||||
@ -78,6 +79,7 @@ public class LogOperationAspect {
|
|||||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||||
if(loginUser != null){
|
if(loginUser != null){
|
||||||
log.setCreatorName(loginUser.getUsername());
|
log.setCreatorName(loginUser.getUsername());
|
||||||
|
log.setCreator(loginUser.getSysUserEntity().getCreator());
|
||||||
}
|
}
|
||||||
|
|
||||||
log.setStatus(status);
|
log.setStatus(status);
|
||||||
@ -89,6 +91,7 @@ public class LogOperationAspect {
|
|||||||
log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
|
log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
|
||||||
log.setRequestUri(request.getRequestURI());
|
log.setRequestUri(request.getRequestURI());
|
||||||
log.setRequestMethod(request.getMethod());
|
log.setRequestMethod(request.getMethod());
|
||||||
|
log.setCreateDate(new Date());
|
||||||
|
|
||||||
//请求参数
|
//请求参数
|
||||||
Object[] args = joinPoint.getArgs();
|
Object[] args = joinPoint.getArgs();
|
||||||
|
Loading…
Reference in New Issue
Block a user