Files
Tbed/src/main/java/cn/hellohao/config/WebImgConfigurer.java
T
2021-11-29 11:27:26 +08:00

21 lines
597 B
Java

package cn.hellohao.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.io.File;
@Configuration
public class WebImgConfigurer implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
String filePath = GlobalConstant.LOCPATH + File.separator;
registry.addResourceHandler("/ota/**").addResourceLocations("file:"+filePath);
}
}