From e0249e5e6e0a41fc5ec950ff41556e054b21ab85 Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 18 May 2020 15:31:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=91=E6=8E=A7=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E4=B9=B1=E7=A0=81=E9=97=AE=E9=A2=98.=20thx=20for=20?= =?UTF-8?q?=E6=B8=85=E9=A3=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gatewaycommon/gateway/result/GatewayResultExecutor.java | 6 ++++++ .../servercommon/configuration/GlobalExceptionHandler.java | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java index d3e891a5..87df32b9 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/result/GatewayResultExecutor.java @@ -14,8 +14,11 @@ import com.gitee.sop.gatewaycommon.result.ResultExecutorForGateway; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import org.springframework.web.server.ServerWebExchange; +import org.springframework.web.util.UriUtils; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Locale; @@ -46,6 +49,9 @@ public class GatewayResultExecutor extends BaseExecutorAdapter at ").append(stackTraceElement.toString()); } - response.setHeader("x-service-error-message", msg.toString()); + response.setHeader("x-service-error-message", UriUtils.encode(msg.toString(), StandardCharsets.UTF_8)); return this.processError(request, response, new ServiceException("系统繁忙")); }