ソースを参照

本地文件映射

yangshun 3 週間 前
コミット
7d2f4df7b4

+ 5 - 5
guoyan-framework/guoyan-spring-boot-starter-web/src/main/java/com/cy/guoyan/admin/framework/web/config/GuoyanWebAutoConfiguration.java

@@ -62,11 +62,11 @@ public class GuoyanWebAutoConfiguration implements WebMvcConfigurer {
         configurePathMatch(configurer, webProperties.getAppApi());
     }
 
-//    @Override
-//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
-//        String fileSavePathUri = "file:" + fileUploadDir.replace("\\", "/");
-//        registry.addResourceHandler(fileAccessPath).addResourceLocations(fileSavePathUri);
-//    }
+    @Override
+    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+        String fileSavePathUri = "file:" + fileUploadDir.replace("\\", "/");
+        registry.addResourceHandler(fileAccessPath).addResourceLocations(fileSavePathUri);
+    }
 
     /**
      * 设置 API 前缀,仅仅匹配 controller 包下的

+ 0 - 7
guoyan-server/src/main/java/com/cy/guoyan/admin/server/GuoyanServerApplication.java

@@ -20,13 +20,6 @@ import java.io.IOException;
 public class GuoyanServerApplication {
 
     public static void main(String[] args) {
-        // 启动 Redis 服务
-        RedisServer redisServer = new RedisServer(6380);
-        try {
-            redisServer.start();
-        } catch (IOException e) {
-            throw new RuntimeException(e);
-        }
         // 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
         // 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章
         // 如果你碰到启动的问题,请认真阅读 https://doc.iocoder.cn/quick-start/ 文章