|
@@ -1,9 +1,8 @@
|
|
|
package com.persagy.dmp.file.config;
|
|
|
|
|
|
-import com.persagy.dmp.auth.handler.AppContextHandler;
|
|
|
-import com.persagy.dmp.file.controller.CompatibleOldFileController;
|
|
|
import com.persagy.dmp.file.handler.OldFileAuthHandler;
|
|
|
import com.persagy.dmp.file.handler.OldFileContextHandler;
|
|
|
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.core.annotation.Order;
|
|
@@ -12,6 +11,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
|
|
@Configuration
|
|
|
@Order(100)
|
|
|
+@ConditionalOnProperty(value = "persagy.common.file.storage", havingValue = "2")
|
|
|
public class FileWebConfigurer implements WebMvcConfigurer {
|
|
|
/***
|
|
|
* Description: 旧文件的上下文处理器
|
|
@@ -21,6 +21,7 @@ public class FileWebConfigurer implements WebMvcConfigurer {
|
|
|
* Update By lijie 2021/11/19 10:12
|
|
|
*/
|
|
|
@Bean
|
|
|
+
|
|
|
public OldFileContextHandler oldFileContextHandler() {
|
|
|
return new OldFileContextHandler();
|
|
|
}
|
|
@@ -56,7 +57,7 @@ public class FileWebConfigurer implements WebMvcConfigurer {
|
|
|
"/common/image_upload"};
|
|
|
registry.addInterceptor(oldFileAuthHandler())
|
|
|
.order(101)
|
|
|
- .addPathPatterns()
|
|
|
+ .addPathPatterns(authIncludePaths)
|
|
|
.excludePathPatterns(excludePaths);
|
|
|
}
|
|
|
|