From bffdc5bf8f642ae80325a2558addb911037c46a3 Mon Sep 17 00:00:00 2001 From: tanghc Date: Mon, 29 Apr 2019 17:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96Locale?= =?UTF-8?q?=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gitee/sop/servercommon/bean/ServiceContext.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/bean/ServiceContext.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/bean/ServiceContext.java index 86936fc5..73877b2d 100644 --- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/bean/ServiceContext.java +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/bean/ServiceContext.java @@ -31,7 +31,11 @@ public class ServiceContext extends ConcurrentHashMap { } public Locale getLocale() { - return getRequest().getLocale(); + HttpServletRequest request = getRequest(); + if (request == null) { + return Locale.SIMPLIFIED_CHINESE; + } + return request.getLocale(); } /**