tanghc 5 years ago
parent f47c912f07
commit f5ef9b2cab
  1. 10
      sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/BaseServiceConfiguration.java

@ -48,9 +48,17 @@ public class BaseServiceConfiguration extends WebMvcConfigurationSupport
super.addInterceptors(registry); super.addInterceptors(registry);
} }
@Override /*@Override
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) { protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(new StringHttpMessageConverter(StandardCharsets.UTF_8));
}*/
@Override
protected void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
// 解决controller返回字符串中文乱码问题 // 解决controller返回字符串中文乱码问题
// 移除老的
//converters.removeIf(converter -> converter instanceof StringHttpMessageConverter);
// 添加信息的
converters.add(new StringHttpMessageConverter(StandardCharsets.UTF_8)); converters.add(new StringHttpMessageConverter(StandardCharsets.UTF_8));
} }

Loading…
Cancel
Save