From a1beed5b5e68324654fdb9f760b6edf2abddd0ae Mon Sep 17 00:00:00 2001 From: thinkgem Date: Tue, 11 Mar 2025 15:23:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=8E=B7=E5=8F=96=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=EF=BC=8C=E6=94=AF=E6=8C=81=E4=BB=8E=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E4=B8=AD=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jeesite/common/io/PropertiesUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java b/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java index 1b86da6d..d2998781 100644 --- a/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java +++ b/common/src/main/java/com/jeesite/common/io/PropertiesUtils.java @@ -174,7 +174,7 @@ public class PropertiesUtils { private static final Pattern p1 = Pattern.compile("\\$\\{.*?\\}"); /** - * 获取属性值,取不到从System.getProperty()获取,都取不到返回null + * 获取属性值,取不到从System.getProperty和System.getenv获取,都取不到返回null */ public String getProperty(String key) { if (environment != null){ @@ -196,9 +196,10 @@ public class PropertiesUtils { String systemProperty = System.getProperty(key); if (systemProperty != null) { return systemProperty; + }else{ + return System.getenv(key); } } - return null; } /**