| | |
| | | |
| | | import java.util.concurrent.TimeUnit; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.http.CacheControl; |
| | |
| | | @Configuration |
| | | public class ResourcesConfig implements WebMvcConfigurer |
| | | { |
| | | @Value("${file.path.dcPath}") |
| | | private String dcPath; |
| | | |
| | | @Autowired |
| | | private RepeatSubmitInterceptor repeatSubmitInterceptor; |
| | | |
| | |
| | | registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**") |
| | | .addResourceLocations("file:" + RuoYiConfig.getProfile() + "/"); |
| | | |
| | | |
| | | /** swagger配置 */ |
| | | registry.addResourceHandler("/swagger-ui/**") |
| | | .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/") |
| | | .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());; |
| | | .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic()); |
| | | //文件访问路径 |
| | | registry.addResourceHandler("/uploadfile/**") |
| | | .addResourceLocations("file:" + dcPath); |
| | | } |
| | | |
| | | /** |