fix(操作日志): 操作日志存储列长度保护

This commit is contained in:
fit2-zhao 2021-07-01 18:17:09 +08:00 committed by fit2-zhao
parent 6381462a4d
commit c8c2432868
1 changed files with 6 additions and 0 deletions

View File

@ -244,6 +244,12 @@ public class MsLogAspect {
}
String path = request.getServletPath();
if (StringUtils.isNotEmpty(msOperLog.getSourceId()) && msOperLog.getSourceId().length() > 6000) {
msOperLog.setSourceId(msOperLog.getSourceId().substring(0, 5999));
}
if (StringUtils.isNotEmpty(msOperLog.getOperTitle()) && msOperLog.getOperTitle().length() > 6000) {
msOperLog.setOperTitle(msOperLog.getOperTitle().substring(0, 5999));
}
msOperLog.setOperPath(path);
operatingLogService.create(msOperLog);
}