Kaynağa Gözat

日志注解限制operUrl属性的长度

RuoYi 3 yıl önce
ebeveyn
işleme
5b6dc85b62

+ 1 - 1
ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java

@@ -76,7 +76,7 @@ public class LogAspect
76
             // 请求的地址
76
             // 请求的地址
77
             String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
77
             String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
78
             operLog.setOperIp(ip);
78
             operLog.setOperIp(ip);
79
-            operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
79
+            operLog.setOperUrl(StringUtils.substring(ServletUtils.getRequest().getRequestURI(), 0, 255));
80
             String username = SecurityUtils.getUsername();
80
             String username = SecurityUtils.getUsername();
81
             if (StringUtils.isNotBlank(username))
81
             if (StringUtils.isNotBlank(username))
82
             {
82
             {