修复Log注解GET请求记录不到参数问题

This commit is contained in:
RuoYi
2022-12-03 13:20:48 +08:00
parent f646bfc0f5
commit a8be0ccb35
6 changed files with 44 additions and 16 deletions

View File

@@ -102,7 +102,6 @@ public class LogAspect
catch (Exception exp)
{
// 记录本地异常日志
log.error("==前置通知异常==");
log.error("异常信息:{}", exp.getMessage());
exp.printStackTrace();
}
@@ -150,6 +149,11 @@ public class LogAspect
String params = argsArrayToString(joinPoint.getArgs());
operLog.setOperParam(StringUtils.substring(params, 0, 2000));
}
else
{
Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter()), 0, 2000));
}
}
/**