教育训练处考试制证系统后端
zf
2023-09-07 67ba3d8510c75f62c53d97399d8b9ef3d01196c8
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
@@ -2,6 +2,7 @@
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.CacheControl;
@@ -23,6 +24,9 @@
@Configuration
public class ResourcesConfig implements WebMvcConfigurer
{
    @Value("${file.path.dcPath}")
    private String dcPath;
    @Autowired
    private RepeatSubmitInterceptor repeatSubmitInterceptor;
@@ -33,10 +37,14 @@
        registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**")
                .addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
        /** swagger配置 */
        registry.addResourceHandler("/swagger-ui/**")
                .addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/")
                .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());;
                .setCacheControl(CacheControl.maxAge(5, TimeUnit.HOURS).cachePublic());
        //文件访问路径
        registry.addResourceHandler("/uploadfile/**")
                .addResourceLocations("file:" + dcPath);
    }
    /**