mirror of
https://github.com/Hello-hao/Tbed.git
synced 2024-04-21 12:32:10 +00:00
重构版功能实现
This commit is contained in:
@@ -13,10 +13,6 @@ public class WebImgConfigurer implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
String filePath = File.separator + "HellohaoData" + File.separator;
|
||||
//和页面有关的静态目录都放在项目的static目录下
|
||||
//registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
|
||||
//上传的图片在D盘下的OTA目录下,访问路径如:http://localhost:8081/OTA/d3cf0281-bb7f-40e0-ab77-406db95ccf2c.jpg
|
||||
//其中OTA表示访问的前缀。"file:D:/OTA/"是文件真实的存储路径
|
||||
registry.addResourceHandler("/ota/**").addResourceLocations("file:"+filePath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user