排序属性orderBy参数限制长度

master
RuoYi 1 year ago
parent 4d5c204b9a
commit 1ffb6379f7

@ -20,6 +20,11 @@ public class SqlUtil
*/ */
public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+"; public static String SQL_PATTERN = "[a-zA-Z0-9_\\ \\,\\.]+";
/**
* orderBy
*/
private static final int ORDER_BY_MAX_LENGTH = 500;
/** /**
* *
*/ */
@ -29,6 +34,10 @@ public class SqlUtil
{ {
throw new UtilException("参数不符合规范,不能进行查询"); throw new UtilException("参数不符合规范,不能进行查询");
} }
if (StringUtils.length(value) > ORDER_BY_MAX_LENGTH)
{
throw new UtilException("参数已超过最大限制,不能进行查询");
}
return value; return value;
} }

Loading…
Cancel
Save