修改json序列化配置bug

This commit is contained in:
joylink_zhangsai 2023-07-26 14:32:00 +08:00
parent b6c89e3857
commit 5658ef7ad7

View File

@ -24,8 +24,7 @@ public class JsonConfig implements ApplicationRunner {
@Bean
public HttpMessageConverters fastJsonHttpMessageConverters() {
FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter();
converter.getFastJsonConfig().setWriterFeatures(Feature.WriteByteArrayAsBase64);
converter.getFastJsonConfig().setWriterFeatures(Feature.WriteEnumsUsingName);
converter.getFastJsonConfig().setWriterFeatures(Feature.WriteByteArrayAsBase64, Feature.WriteEnumsUsingName);
converter.getFastJsonConfig().setReaderFeatures(JSONReader.Feature.Base64StringAsByteArray);
return new HttpMessageConverters(converter);
}