Browse Source

feat: 增加操作日志的操作人和操作时间

pull/1/head
weihongyang 2 years ago
parent
commit
16e656d820
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      ym-admin/src/main/java/com/cnbm/admin/aspect/LogOperationAspect.java

+ 3
- 0
ym-admin/src/main/java/com/cnbm/admin/aspect/LogOperationAspect.java View File

@@ -21,6 +21,7 @@ import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Date;

/**
* @Author weihongyang
@@ -78,6 +79,7 @@ public class LogOperationAspect {
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
if(loginUser != null){
log.setCreatorName(loginUser.getUsername());
log.setCreator(loginUser.getSysUserEntity().getCreator());
}

log.setStatus(status);
@@ -89,6 +91,7 @@ public class LogOperationAspect {
log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT));
log.setRequestUri(request.getRequestURI());
log.setRequestMethod(request.getMethod());
log.setCreateDate(new Date());

//请求参数
Object[] args = joinPoint.getArgs();


Loading…
Cancel
Save