v2
This commit is contained in:
19
src/main/java/com/hertz/system/config/WebMvcConfig.java
Normal file
19
src/main/java/com/hertz/system/config/WebMvcConfig.java
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.hertz.system.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebMvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Value("${app.upload.root-path}")
|
||||
private String uploadRootPath;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/uploads/**")
|
||||
.addResourceLocations("file:" + uploadRootPath + "/");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user