From 2ece6f6cd23d7b717881dd54a9fc74877096ecee Mon Sep 17 00:00:00 2001
From: wuxw7 <wuxw7@asiainfo.com>
Date: 星期一, 07 五月 2018 23:13:59 +0800
Subject: [PATCH] 控制服务实现登录功能 和菜单展示,以及中心服务bug修复

---
 CenterService/src/main/java/com/java110/center/CenterServiceApplicationStart.java |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/CenterService/src/main/java/com/java110/center/CenterServiceApplicationStart.java b/CenterService/src/main/java/com/java110/center/CenterServiceApplicationStart.java
index bd6ea4b..19c6f96 100644
--- a/CenterService/src/main/java/com/java110/center/CenterServiceApplicationStart.java
+++ b/CenterService/src/main/java/com/java110/center/CenterServiceApplicationStart.java
@@ -3,11 +3,15 @@
 import com.java110.event.center.init.CenterServiceStartInit;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.web.client.RestTemplateBuilder;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
+import org.springframework.http.converter.StringHttpMessageConverter;
 import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.Charset;
 
 
 /**
@@ -31,7 +35,9 @@
     @Bean
     @LoadBalanced
     public RestTemplate restTemplate() {
-        return new RestTemplate();
+        StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8"));
+        RestTemplate restTemplate = new RestTemplateBuilder().additionalMessageConverters(m).build();
+        return restTemplate;
     }
 
     public static void main(String[] args) throws Exception{

--
Gitblit v1.8.0