From 8ffde31707c3ebc1e2f92c916b9362460cd62e15 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Thu, 10 Feb 2022 13:50:24 +0800 Subject: [PATCH] =?UTF-8?q?[manager]fix=E4=B8=8D=E5=90=8C=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E5=BC=80=E5=8F=91=E5=92=8C=E9=83=A8=E7=BD=B2=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E8=AF=BB=E5=8F=96=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/usthe/manager/service/impl/AppServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java b/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java index 3d7ec28..8b76cde 100644 --- a/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java +++ b/manager/src/main/java/com/usthe/manager/service/impl/AppServiceImpl.java @@ -123,11 +123,11 @@ public class AppServiceImpl implements AppService, CommandLineRunner { public void run(String... args) throws Exception { // 读取app定义配置加载到内存中 define/app/*.yml Yaml yaml = new Yaml(); - String classpath = this.getClass().getResource(File.separator).getPath(); + String classpath = this.getClass().getClassLoader().getResource("").getPath(); String defineAppPath = classpath + File.separator + "define" + File.separator + "app"; File directory = new File(defineAppPath); if (!directory.exists() || directory.listFiles() == null) { - classpath = this.getClass().getResource("").getPath(); + classpath = this.getClass().getResource(File.separator).getPath(); defineAppPath = classpath + File.separator + "define" + File.separator + "app"; directory = new File(defineAppPath); if (!directory.exists() || directory.listFiles() == null) {