From 06739df89671ad4ba7e582f35127c36cdf14f44f Mon Sep 17 00:00:00 2001 From: taojinlong Date: Fri, 13 Dec 2024 15:43:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dexcel=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/dataease/datasource/provider/ExcelUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java index 145020f470..b065f49711 100644 --- a/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java +++ b/core/core-backend/src/main/java/io/dataease/datasource/provider/ExcelUtils.java @@ -321,6 +321,10 @@ public class ExcelUtils { if (StringUtils.isEmpty(value) || value.length() > 19) { return "TEXT"; } + String numberFormatRegex = "^[1-9]\\d*$"; + if (!value.matches(numberFormatRegex)) { + return "TEXT"; + } String regex = "^-?\\d+(\\.\\d+)?$"; if (!value.matches(regex)) { return "TEXT";