feat(system): 记录请求方法到操作日志- 在 Log 实体类中新增 method 字段用于存储请求方法- 在 LogAspect 切面中获取并设置请求方法名到日志对象- 完善操作日志记录功能,增强日志可追溯性

This commit is contained in:
theo
2025-11-10 11:42:12 +08:00
parent 95412501fc
commit 9d6553bbfa
2 changed files with 8 additions and 0 deletions

View File

@@ -138,6 +138,9 @@ public class LogAspect {
log.setBrowser(userAgent.getBrowser().getName());
log.setBrowserVersion(userAgent.getBrowser().getVersion(userAgentString));
}
//获取方法名
String methodName = joinPoint.getSignature().getName();
log.setMethod(methodName);
// 保存日志到数据库
logService.save(log);
}

View File

@@ -56,6 +56,11 @@ public class Log implements Serializable {
*/
private String requestUri;
/**
* 请求方法
*/
private String method;
/**
* IP 地址
*/