From c305af6a6bb2b698b02d731ac27218bff51c5c1c Mon Sep 17 00:00:00 2001 From: lihengming <89921218@qq.com> Date: Tue, 4 Sep 2018 19:32:46 +0800 Subject: [PATCH] fix #134 --- .../java/com/company/project/configurer/WebMvcConfigurer.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/company/project/configurer/WebMvcConfigurer.java b/src/main/java/com/company/project/configurer/WebMvcConfigurer.java index 5292390..c9460d3 100644 --- a/src/main/java/com/company/project/configurer/WebMvcConfigurer.java +++ b/src/main/java/com/company/project/configurer/WebMvcConfigurer.java @@ -3,6 +3,7 @@ package com.company.project.configurer; import java.io.IOException; import java.nio.charset.Charset; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -24,6 +25,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; +import org.springframework.http.MediaType; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.web.method.HandlerMethod; import org.springframework.web.servlet.HandlerExceptionResolver; @@ -56,6 +58,7 @@ public class WebMvcConfigurer extends WebMvcConfigurerAdapter { converter.setFastJsonConfig(config); converter.setDefaultCharset(Charset.forName("UTF-8")); + converter.setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_JSON_UTF8)); converters.add(converter); }