重构AOP日志功能,新增日志查询、删除接口及相关页面,优化日志管理体验;更新前端组件以支持日志展示和操作。

This commit is contained in:
Chuck1sn
2025-07-08 13:03:59 +08:00
parent 0a0174c01e
commit eecc8bedae
26 changed files with 4424 additions and 2489 deletions

View File

@@ -48,17 +48,11 @@ public class LoggingAspect {
return processWithLogging(joinPoint, aopLog);
}
@Around("execution(* com.zl.mjga.service..*(..))")
public Object logService(ProceedingJoinPoint joinPoint) throws Throwable {
AopLog aopLog = new AopLog();
return processWithLogging(joinPoint, aopLog);
}
@Around("execution(* com.zl.mjga.repository..*(..))")
public Object logRepository(ProceedingJoinPoint joinPoint) throws Throwable {
AopLog aopLog = new AopLog();
return processWithLogging(joinPoint, aopLog);
}
// @Around("execution(* com.zl.mjga.service..*(..))")
// public Object logService(ProceedingJoinPoint joinPoint) throws Throwable {
// AopLog aopLog = new AopLog();
// return processWithLogging(joinPoint, aopLog);
// }
private Object processWithLogging(ProceedingJoinPoint joinPoint, AopLog aopLog) throws Throwable {
if (shouldSkipLogging(joinPoint) || !isUserAuthenticated()) {
@@ -82,7 +76,7 @@ public class LoggingAspect {
private Long getCurrentUserId() {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
String username = (String) authentication.getPrincipal();
String username = authentication.getName();
User user = userRepository.fetchOneByUsername(username);
return user.getId();
}