Commit 92bc2456 authored by Quxl's avatar Quxl

ff

parent d67f1a31
......@@ -10,6 +10,8 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import com.egolm.common.StringUtil;
@Component
public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
......@@ -21,6 +23,9 @@ public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
for(Cookie cookie : cookies) {
if(cookie.getName().equals(language)) {
String str = cookie.getValue();
if(StringUtil.isBlank(str)) {
str = "zh_CN";
}
String[] kv = str.split("_");
String language = kv[0];
String country = kv.length == 2 ? kv[1] : null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment