From 713fbe44510787b05309347231498d1b7ecc6b86 Mon Sep 17 00:00:00 2001 From: codax <8036618+codax@user.noreply.gitee.com> Date: Tue, 29 Jul 2025 10:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A4=E8=AF=81=E9=89=B4?= =?UTF-8?q?=E6=9D=83=E5=8F=96=E9=85=8D=E7=BD=AE=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/DefaultCatPropertyProvider.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/cat-home/src/main/java/com/dianping/cat/system/page/login/service/DefaultCatPropertyProvider.java b/cat-home/src/main/java/com/dianping/cat/system/page/login/service/DefaultCatPropertyProvider.java index 892d310048..5f27167efe 100644 --- a/cat-home/src/main/java/com/dianping/cat/system/page/login/service/DefaultCatPropertyProvider.java +++ b/cat-home/src/main/java/com/dianping/cat/system/page/login/service/DefaultCatPropertyProvider.java @@ -18,21 +18,26 @@ */ package com.dianping.cat.system.page.login.service; +import org.apache.commons.lang3.StringUtils; + // Component public class DefaultCatPropertyProvider implements CatPropertyProvider { - public String getProperty(final String name, final String defaultValue) { - String value = null; + public String getProperty(final String name, final String defaultValue) { + String value = null; - // try to get value from system properties, -D= - if (value == null) { - value = System.getProperty(name); - } + // try to get value from system properties, -D= + if (value == null) { + value = System.getProperty(name); + } - // try to get value from environment variable - if (value == null) { - value = System.getenv(name); - } + // try to get value from environment variable + if (value == null) { + value = System.getenv(name); + } - return defaultValue; - } + if (StringUtils.isBlank(value)) { + return defaultValue; + } + return value; + } }