修复获取Locale空问题

This commit is contained in:
tanghc
2019-04-29 17:17:24 +08:00
parent 543db4390d
commit bffdc5bf8f

View File

@@ -31,7 +31,11 @@ public class ServiceContext extends ConcurrentHashMap<String, Object> {
} }
public Locale getLocale() { public Locale getLocale() {
return getRequest().getLocale(); HttpServletRequest request = getRequest();
if (request == null) {
return Locale.SIMPLIFIED_CHINESE;
}
return request.getLocale();
} }
/** /**