增加默认值

This commit is contained in:
thinkgem
2025-02-07 20:44:16 +08:00
parent 8b54a7c0e8
commit 1b32b7700a
2 changed files with 6 additions and 4 deletions

View File

@@ -266,7 +266,7 @@ public class EncodeUtils {
"(?:')|(?:--)|(/\\*(?:.|[\\n\\r])*?\\*/)|((extractvalue|updatexml|if|mid|database|rand|user)([\\s]*?)\\()"
+ "|(\\b(select|update|and|or|delete|insert|trancate|substr|ascii|declare|exec|count|master|into"
+ "|drop|execute|case when|sleep|union|load_file)\\b)", Pattern.CASE_INSENSITIVE);
private static final Pattern orderByPattern = Pattern.compile("[a-z0-9_\\.\\, ]*", Pattern.CASE_INSENSITIVE);
private static final Pattern simplePattern = Pattern.compile("[a-z0-9_\\.\\, ]*", Pattern.CASE_INSENSITIVE);
/**
* SQL过滤防止注入传入参数输入有select相关代码替换空。
@@ -283,8 +283,8 @@ public class EncodeUtils {
public static String sqlFilter(String text, String source){
if (text != null){
String value = text;
if ("orderBy".equals(source)) {
Matcher matcher = orderByPattern.matcher(value);
if ("simple".equals(source) || "orderBy".equals(source)) {
Matcher matcher = simplePattern.matcher(value);
if (!matcher.matches()) {
value = StringUtils.EMPTY;
}

View File

@@ -56,7 +56,9 @@
<% if(@Global.getConfigToBoolean('user.loginCodeCorpUnique', 'false')){ %>
<div class="form-group has-feedback">
<#form:treeselect id="switchCorpSelect" title="${text('登录租户')}" allowClear="false"
name="param_corpCode" url="${ctxAdmin}/sys/corpAdmin/treeData?isShowCode=true" placeholder="${text('登录租户')}"/>
name="param_corpCode" value="${@CorpUtils.getCurrentCorpCode()}"
labelValue="(${@CorpUtils.getCurrentCorpCode()}) ${@CorpUtils.getCurrentCorpName()}"
url="${ctxAdmin}/sys/corpAdmin/treeData?isShowCode=true" placeholder="${text('登录租户')}"/>
</div>
<% } %>
<div class="form-group has-feedback" id="isValidCodeLogin" style="display:${isValidCodeLogin?'blank':'none'}">