| | |
| | | |
| | | 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; |
| | |
| | | @Autowired |
| | | private RepeatSubmitInterceptor repeatSubmitInterceptor; |
| | | |
| | | @Value("${file.path}") |
| | | private String filePath; |
| | | |
| | | @Value("${wordUrl}") |
| | | private String wordUrl; |
| | | |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) |
| | | { |
| | |
| | | registry.addResourceHandler("/doc.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/favicon.ico").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | |
| | | //设置文件虚拟路径映射 |
| | | registry.addResourceHandler("/img/**").addResourceLocations("file:"+filePath+"/"); |
| | | registry.addResourceHandler("/word/**").addResourceLocations("file:"+wordUrl+"/"); |
| | | } |
| | | |
| | | /** |