From 6fd3419487e651a75c8c1a63098383ab98d26698 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期三, 26 十一月 2025 09:08:41 +0800
Subject: [PATCH] 新增访问路径

---
 jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/config/WebConfig.java |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/config/WebConfig.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/config/WebConfig.java
new file mode 100644
index 0000000..2cf7ce7
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/config/WebConfig.java
@@ -0,0 +1,26 @@
+package cn.lihu.jh.module.ecg.config;
+
+import cn.lihu.jh.module.infra.dal.dataobject.config.ConfigDO;
+import cn.lihu.jh.module.infra.service.config.ConfigService;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import javax.annotation.Resource;
+
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+
+    @Resource
+    private ConfigService configService;
+
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        ConfigDO configByKey = configService.getConfigByKey("file.upload.path");
+
+        // 閰嶇疆 /profile/** 鏄犲皠鍒版枃浠剁郴缁熻矾寰�
+        registry.addResourceHandler("/profile/**").addResourceLocations("file:" + configByKey.getValue() + "/");
+
+    }
+}

--
Gitblit v1.9.3