以war启动,multipartConfigElement 配置了数据上传大小导致 servlet.multipart.max-file-size = 10M 会不生效
    /打war包放开/
    @Configuration
    @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class})
    public class LnywApplication extends SpringBootServletInitializer {

    1. public static void main(String[] args) {<br /> SpringApplication.run(LnywApplication.class, args);<br /> }
    2. @Override<br /> protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {<br /> return builder.sources(LnywApplication.class);<br /> }
    3. @Bean<br /> public MultipartConfigElement multipartConfigElement() {<br /> //qzf 2021-12-30 10:34:59 servlet.multipart.max-file-size = 10M 会不生效<br /> MultipartConfigFactory factory = new MultipartConfigFactory();<br /> factory.setMaxFileSize(DataSize.parse("10MB"));<br /> factory.setMaxRequestSize(DataSize.parse("150MB"));<br /> return factory.createMultipartConfig();<br /> }<br />}