| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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() + "/"); |
| | | |
| | | } |
| | | } |