|
|
@@ -2,14 +2,30 @@ package com.java110.boot.configuration;
|
|
|
|
|
|
import com.java110.boot.filter.JwtFilter;
|
|
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
|
|
+import org.springframework.boot.web.servlet.MultipartConfigFactory;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
|
+import javax.servlet.MultipartConfigElement;
|
|
|
+
|
|
|
/**
|
|
|
* Created by wuxw on 2018/5/2.
|
|
|
*/
|
|
|
@Configuration
|
|
|
public class ServiceConfiguration {
|
|
|
+ /**
|
|
|
+ * 文件上传配置
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Bean
|
|
|
+ public MultipartConfigElement multipartConfigElement() {
|
|
|
+ MultipartConfigFactory factory = new MultipartConfigFactory();
|
|
|
+ //文件最大
|
|
|
+ factory.setMaxFileSize(1024*1024*50); //KB,MB
|
|
|
+ /// 设置总上传数据总大小
|
|
|
+ factory.setMaxRequestSize(1024*1024*50);
|
|
|
+ return factory.createMultipartConfig();
|
|
|
+ }
|
|
|
@Bean
|
|
|
public FilterRegistrationBean jwtFilter() {
|
|
|
StringBuffer exclusions = new StringBuffer();
|