mirror of
https://github.com/dataease/dataease.git
synced 2026-05-19 18:38:16 +08:00
refactor(工作台): 增加模板限制大小到35MB同时前端增加大小校验
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package io.dataease.jackson;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.core.StreamReadConstraints;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
@@ -23,4 +25,18 @@ public class JacksonConfig {
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Jackson2ObjectMapperBuilderCustomizer customJackson() {
|
||||
return jacksonObjectMapperBuilder -> {
|
||||
// 增大最大字符串长度限制到 350000000(或根据需要设置)
|
||||
StreamReadConstraints constraints = StreamReadConstraints.builder()
|
||||
.maxStringLength(35000000) // 设置更大的限制值
|
||||
.build();
|
||||
|
||||
jacksonObjectMapperBuilder.postConfigurer(objectMapper ->
|
||||
objectMapper.getFactory().setStreamReadConstraints(constraints)
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user