@Configuration
//@EnableMongoRepositories
public class WeaselWebMVCConfig implements WebMvcConfigurer{
@Value("${convert_pdfroot}")
private String convert_pdfroot;
@Bean
public LogInterceptor getLogInterceptor() {
return new LogInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(getLogInterceptor());
WebMvcConfigurer.super.addInterceptors(registry);
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// registry.addResourceHandler("/upload/**").addResourceLocations("file:D:/wekuku_root/upload/"
// ); //+ uploadProperties.getPath());
registry.addResourceHandler("/viewroot/**")
.addResourceLocations("file:" + convert_pdfroot + "/");
}
网友评论