From 850329960b681f92a5d91af4a87608839527b0c8 Mon Sep 17 00:00:00 2001 From: mazhicheng Date: Mon, 6 Jul 2020 19:57:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AF=BB=E5=8F=96druid?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E9=85=8D=E7=BD=AEurl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/diboot/core/util/ContextHelper.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/diboot-core/src/main/java/com/diboot/core/util/ContextHelper.java b/diboot-core/src/main/java/com/diboot/core/util/ContextHelper.java index f4fca5c..22ede98 100644 --- a/diboot-core/src/main/java/com/diboot/core/util/ContextHelper.java +++ b/diboot-core/src/main/java/com/diboot/core/util/ContextHelper.java @@ -253,6 +253,9 @@ public class ContextHelper implements ApplicationContextAware { public static String getJdbcUrl() { Environment environment = getApplicationContext().getEnvironment(); String jdbcUrl = environment.getProperty("spring.datasource.url"); + if(jdbcUrl == null){ + jdbcUrl = environment.getProperty("spring.datasource.druid.url"); + } if(jdbcUrl == null){ String master = environment.getProperty("spring.datasource.dynamic.primary"); jdbcUrl = environment.getProperty("spring.datasource.dynamic.datasource."+master+".url");