package com.tievd.jyz.config;
|
|
import lombok.extern.slf4j.Slf4j;
|
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;
|
|
/**
|
* @author yang'zhi'shui
|
*/
|
@Slf4j
|
@Configuration
|
public class MyWebMvcConfig implements WebMvcConfigurer {
|
|
@Value("${jeecg.path.upload:D:/usr/local/uploadFile}")
|
private String uploadFilePath;
|
|
@Value("${init.local.image-path}")
|
private String localImagePath;
|
|
@Override
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
log.info("配置静态资源路径: {}", localImagePath);
|
registry.addResourceHandler("/sysLogo/**")
|
.addResourceLocations("file:" + uploadFilePath + "/sysLogo/");
|
registry.addResourceHandler("/images/**")
|
.addResourceLocations("file:" + localImagePath + "/");
|
}
|
|
}
|