From 67ba3d8510c75f62c53d97399d8b9ef3d01196c8 Mon Sep 17 00:00:00 2001
From: zf <1603559716@qq.com>
Date: 星期四, 07 九月 2023 09:26:59 +0800
Subject: [PATCH] 考试系统框架整理,以及集成mybatis-plus

---
 ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
index 74fb93e..8541c31 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
+++ b/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);
     }
 
     /**

--
Gitblit v1.9.2