From 8337b95b7319fac87e29b0a762655f4d3796798d Mon Sep 17 00:00:00 2001 From: taojinlong Date: Mon, 30 Oct 2023 12:36:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=99=90=E5=88=B6=20mysql=20=E9=9D=9E?= =?UTF-8?q?=E6=B3=95=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/dto/datasource/MysqlConfiguration.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java b/core/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java index ffffeaf3c6..f30a5ac15f 100644 --- a/core/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java +++ b/core/backend/src/main/java/io/dataease/dto/datasource/MysqlConfiguration.java @@ -5,6 +5,7 @@ import lombok.Getter; import lombok.Setter; import org.apache.commons.lang3.StringUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -20,7 +21,7 @@ public class MysqlConfiguration extends JdbcConfiguration { if (StringUtils.isEmpty(extraParams.trim())) { return "jdbc:mysql://HOSTNAME:PORT/DATABASE".replace("HOSTNAME", getHost().trim()).replace("PORT", getPort().toString().trim()).replace("DATABASE", getDataBase().trim()); } else { - for (String illegalParameter : illegalParameters) { + for (String illegalParameter : getIllegalParameters()) { if (getExtraParams().toLowerCase().contains(illegalParameter.toLowerCase())) { throw new RuntimeException("Illegal parameter: " + illegalParameter); } @@ -29,4 +30,12 @@ public class MysqlConfiguration extends JdbcConfiguration { return "jdbc:mysql://HOSTNAME:PORT/DATABASE?EXTRA_PARAMS".replace("HOSTNAME", getHost().trim()).replace("PORT", getPort().toString().trim()).replace("DATABASE", getDataBase().trim()).replace("EXTRA_PARAMS", getExtraParams().trim()); } } + + public List getIllegalParameters(){ + List newIllegalParameters = new ArrayList<>(); + newIllegalParameters.addAll(illegalParameters); + newIllegalParameters.addAll(Arrays.asList("allowloadlocalinfile", "allowUrlInLocalInfile", "allowLoadLocalInfileInPath")); + return newIllegalParameters; + } + } \ No newline at end of file