|
@ -2,6 +2,7 @@ package com.yihu.jw.gateway.config;
|
|
|
|
|
|
import com.yihu.jw.gateway.filter.CsrfFilter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
|
|
import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
@ -19,10 +20,13 @@ public class MultipartConfig {
|
|
|
@Autowired
|
|
|
CsrfFilter csrfFilter;
|
|
|
|
|
|
@Value("${server.tomcat.basedir}")
|
|
|
String tomcatLocation;
|
|
|
|
|
|
@Bean
|
|
|
MultipartConfigElement multipartConfigElement() {
|
|
|
MultipartConfigFactory factory = new MultipartConfigFactory();
|
|
|
String location = "/data/apps/temp";
|
|
|
String location = tomcatLocation;
|
|
|
File tmpFile = new File(location);
|
|
|
if (!tmpFile.exists()) {
|
|
|
tmpFile.mkdirs();
|