zxl
2026-03-23 74af7e7e3ee39e25f73525391b13face373e350e
jyz-base-start/src/main/java/com/tievd/jyz/config/MyWebMvcConfig.java
@@ -1,5 +1,6 @@
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;
@@ -8,16 +9,23 @@
/**
 * @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 + "/");
    }
}