|
@@ -5,8 +5,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|
|
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.web.multipart.MultipartResolver;
|
|
|
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
|
|
|
|
|
import cn.com.qmth.examcloud.exchange.inner.service.upyun.UpyunSiteManager;
|
|
|
import cn.com.qmth.examcloud.web.bootstrap.AppBootstrap;
|
|
@@ -46,4 +49,14 @@ public class ExchangeApp {
|
|
|
|
|
|
UpyunSiteManager.init();
|
|
|
}
|
|
|
+
|
|
|
+ @Bean(name = "multipartResolver")
|
|
|
+ public MultipartResolver multipartResolver() {
|
|
|
+ CommonsMultipartResolver resolver = new CommonsMultipartResolver();
|
|
|
+ resolver.setDefaultEncoding("UTF-8");
|
|
|
+ resolver.setResolveLazily(true);
|
|
|
+ resolver.setMaxInMemorySize(2);
|
|
|
+ resolver.setMaxUploadSize(100 * 1024 * 1024);
|
|
|
+ return resolver;
|
|
|
+ }
|
|
|
}
|