From ef2e71c373d8318c6fae603bcc6e84ab1ffc6bcd Mon Sep 17 00:00:00 2001 From: stylefeng Date: Thu, 29 Aug 2024 23:44:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.3.0=E3=80=91=E3=80=90config=E3=80=91?= =?UTF-8?q?=E6=9B=B4=E6=96=B0sys=5Fconfig=E8=A1=A8=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E5=88=9D=E5=A7=8B=E5=8C=96=EF=BC=8C=E8=8E=B7=E5=8F=96?= =?UTF-8?q?jar=E8=B7=AF=E5=BE=84=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kernel/config/modular/strategy/DefaultStrategyImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/strategy/DefaultStrategyImpl.java b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/strategy/DefaultStrategyImpl.java index fca93437a..89d8ed0a0 100644 --- a/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/strategy/DefaultStrategyImpl.java +++ b/kernel-d-config/config-business/src/main/java/cn/stylefeng/roses/kernel/config/modular/strategy/DefaultStrategyImpl.java @@ -9,6 +9,7 @@ import cn.stylefeng.roses.kernel.config.api.constants.ConfigConstants; import cn.stylefeng.roses.kernel.config.api.enums.FileStorageTypeEnum; import cn.stylefeng.roses.kernel.config.api.pojo.ConfigInitItem; import cn.stylefeng.roses.kernel.config.modular.service.SysConfigService; +import cn.stylefeng.roses.kernel.rule.util.JarPathUtil; import jakarta.annotation.Resource; import org.springframework.stereotype.Component; @@ -56,8 +57,8 @@ public class DefaultStrategyImpl implements ConfigInitStrategyApi { // 【2024年8月29日新增】设置文件存储的类型,新项目采用10-本地存储(jar启动路径) configInitItems.add(new ConfigInitItem("文件存储类型", ConfigConstants.SYS_FILE_SAVE_TYPE_CONFIG_CODE, String.valueOf(FileStorageTypeEnum.LOCAL_DEFAULT.getCode()), "文件存储位置类型:10-本地存储(jar包所在位置),11-本地存储(指定位置)")); - // 【2024年8月29日新增】获取初始化路径地址 - String localDefaultStoragePath = sysConfigService.initLocalDefaultStoragePath(); + // 【2024年8月29日新增】获取初始化路径地址,默认采用当前目录,所以获取一下当前jar路径 + String localDefaultStoragePath = JarPathUtil.getJarPath(); if(StrUtil.isBlank(localDefaultStoragePath)){ configInitItems.add(new ConfigInitItem("Windows本地文件保存路径", "SYS_LOCAL_FILE_SAVE_PATH_WINDOWS", "D:\\tempFilePath", "本地文件存储的路径,如果没有用本地文件存储,可忽略此配置")); configInitItems.add(new ConfigInitItem("Linux本地文件保存路径", "SYS_LOCAL_FILE_SAVE_PATH_LINUX", "/opt/gunsFilePath", "本地文件存储的路径,上线请注意别使用/tmp目录,如果没有用本地文件存储,可忽略此配置"));