|
|
@@ -4,12 +4,15 @@ import com.uas.sso.util.ContextUtils;
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.boot.context.event.ApplicationPreparedEvent;
|
|
|
+import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
|
|
import org.springframework.context.ApplicationListener;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
|
import org.springframework.context.annotation.ImportResource;
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
|
|
|
|
+import javax.servlet.MultipartConfigElement;
|
|
|
import java.io.File;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.FileOutputStream;
|
|
|
@@ -42,4 +45,16 @@ public class SsoApplication {
|
|
|
});
|
|
|
application.run(args);
|
|
|
}
|
|
|
+
|
|
|
+ @Bean
|
|
|
+ MultipartConfigElement multipartConfigElement() {
|
|
|
+ MultipartConfigFactory factory = new MultipartConfigFactory();
|
|
|
+ String location = "tmp";
|
|
|
+ File tmpFile = new File(location);
|
|
|
+ if (!tmpFile.exists()) {
|
|
|
+ tmpFile.mkdirs();
|
|
|
+ }
|
|
|
+ factory.setLocation(location);
|
|
|
+ return factory.createMultipartConfig();
|
|
|
+ }
|
|
|
}
|