| | |
| | | return new SpringContextHolder(); |
| | | } |
| | | |
| | | @Value("${upload.file.location}") |
| | | private String fileLocation; |
| | | @Value("${upload.file.path}") |
| | | private String filePath; |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | //注册配置类,使用addResourceHandlers方法,将本地路径savePath映射到saveUrl路由上。 |
| | | registry.addResourceHandler(filePath).addResourceLocations(fileLocation); |
| | | WebMvcConfigurer.super.addResourceHandlers(registry); |
| | | } |
| | | // @Value("${upload.file.location}") |
| | | // private String fileLocation; |
| | | // @Value("${upload.file.path}") |
| | | // private String filePath; |
| | | // @Override |
| | | // public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | // //注册配置类,使用addResourceHandlers方法,将本地路径savePath映射到saveUrl路由上。 |
| | | // registry.addResourceHandler(filePath).addResourceLocations(fileLocation); |
| | | // WebMvcConfigurer.super.addResourceHandlers(registry); |
| | | // } |
| | | |
| | | } |