From 9b51a62597487073b54aa27cdd059828ebfcb2ac Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 08 Jul 2022 19:19:47 +0800
Subject: [PATCH] 加synchronized

---
 src/main/java/com/xcong/farmer/cms/configurations/WebMvcConfig.java |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/xcong/farmer/cms/configurations/WebMvcConfig.java b/src/main/java/com/xcong/farmer/cms/configurations/WebMvcConfig.java
index 86faea6..6e527c6 100644
--- a/src/main/java/com/xcong/farmer/cms/configurations/WebMvcConfig.java
+++ b/src/main/java/com/xcong/farmer/cms/configurations/WebMvcConfig.java
@@ -1,19 +1,24 @@
 package com.xcong.farmer.cms.configurations;
 
+import com.xcong.farmer.cms.common.contants.AppContants;
+import com.xcong.farmer.cms.configurations.properties.ApplicationProperties;
 import com.xcong.farmer.cms.utils.SpringContextHolder;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.SpringBootConfiguration;
 import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
 import org.springframework.web.servlet.config.annotation.CorsRegistry;
 import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
 import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
 
 /**
  * @author wzy
  * @date 2020-04-27 11:54
  **/
-@SpringBootConfiguration
 @Slf4j
+@SpringBootConfiguration
 public class WebMvcConfig implements WebMvcConfigurer {
 
     @Override
@@ -33,8 +38,21 @@
                 .allowCredentials(true).maxAge(3600);
     }
 
-    @Bean
-    public SpringContextHolder springContextHolder() {
-        return new SpringContextHolder();
-    }
+//    @Bean
+//    public SpringContextHolder springContextHolder() {
+//        System.out.println(111111);
+//        return new SpringContextHolder();
+//    }
+
+//    @Value("${upload.file.location}")
+//    private String fileLocation;
+//    @Value("${upload.file.path}")
+//    private String filePath;
+//    @Override
+//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
+//        //注册配置类,使用addResourceHandlers方法,将本地路径savePath映射到saveUrl路由上。
+//        registry.addResourceHandler(filePath).addResourceLocations(fileLocation);
+//        WebMvcConfigurer.super.addResourceHandlers(registry);
+//    }
+
 }

--
Gitblit v1.9.1