| | |
| | | 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; |
| | | |
| | |
| | | ConfigDO configByKey = configService.getConfigByKey("file.upload.path"); |
| | | |
| | | // 配置 /profile/** 映射到文件系统路径 |
| | | registry.addResourceHandler("/profile/**").addResourceLocations("file:" + configByKey.getValue() + "/"); |
| | | |
| | | if (configByKey != null) { |
| | | registry.addResourceHandler("/profile/**").addResourceLocations("file:" + configByKey.getValue() + "/"); |
| | | } |
| | | } |
| | | } |