Commit 2854b7df by tyfanchz

移动feign配置到nacos上

1 parent aa9d8384
...@@ -77,8 +77,13 @@ public class GlobalExceptionHandler { ...@@ -77,8 +77,13 @@ public class GlobalExceptionHandler {
@ExceptionHandler({FeignException.class}) @ExceptionHandler({FeignException.class})
public R handleFeignException(FeignException e) { public R handleFeignException(FeignException e) {
log.error("!!!! 远程服务错误", e); log.error("!!!! 远程服务错误", e);
String respMessage;
if (StringUtils.isNotBlank(e.contentUTF8())) {
JSONObject respObj = JSON.parseObject(e.contentUTF8()); JSONObject respObj = JSON.parseObject(e.contentUTF8());
String respMessage = respObj.getString("message"); respMessage = respObj.getString("message");
} else {
respMessage = "";
}
int code = ResultEnum.REMOTE_SERVICE_ERROR.getCode(); int code = ResultEnum.REMOTE_SERVICE_ERROR.getCode();
String message = StringUtils.isBlank(respMessage) String message = StringUtils.isBlank(respMessage)
? ResultEnum.REMOTE_SERVICE_ERROR.getMessage() : respMessage; ? ResultEnum.REMOTE_SERVICE_ERROR.getMessage() : respMessage;
......
...@@ -13,8 +13,7 @@ logging.level.org.springframework.boot.autoconfigure=off ...@@ -13,8 +13,7 @@ logging.level.org.springframework.boot.autoconfigure=off
logging.level.com.glsx.admin=DEBUG logging.level.com.glsx.admin=DEBUG
logging.path=/data/java_log/jetty/smartService/chejia-smart-admin logging.path=/data/java_log/jetty/smartService/chejia-smart-admin
feign.server.name=chejia-smart-service # feign\u914D\u7F6E
feign.server.url=http://localhost:8209/smartService
feign.client.config.default.connect-timeout=20000 feign.client.config.default.connect-timeout=20000
feign.client.config.default.read-timeout=20000 feign.client.config.default.read-timeout=20000
# \u5F00\u542F\u7194\u65AD # \u5F00\u542F\u7194\u65AD
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!