Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
member-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
member-api
Commits
d67f1a31
Commit
d67f1a31
authored
Nov 13, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
国际化
parent
5ecfe004
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
LocaleCookieInterceptor.java
...golm/film/config/interceptor/LocaleCookieInterceptor.java
+5
-1
No files found.
src/main/java/com/egolm/film/config/interceptor/LocaleCookieInterceptor.java
View file @
d67f1a31
...
@@ -20,7 +20,11 @@ public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
...
@@ -20,7 +20,11 @@ public class LocaleCookieInterceptor extends HandlerInterceptorAdapter {
Cookie
[]
cookies
=
req
.
getCookies
();
Cookie
[]
cookies
=
req
.
getCookies
();
for
(
Cookie
cookie
:
cookies
)
{
for
(
Cookie
cookie
:
cookies
)
{
if
(
cookie
.
getName
().
equals
(
language
))
{
if
(
cookie
.
getName
().
equals
(
language
))
{
LocaleContextHolder
.
setLocale
(
new
Locale
(
cookie
.
getValue
()));
String
str
=
cookie
.
getValue
();
String
[]
kv
=
str
.
split
(
"_"
);
String
language
=
kv
[
0
];
String
country
=
kv
.
length
==
2
?
kv
[
1
]
:
null
;
LocaleContextHolder
.
setLocale
(
new
Locale
(
language
,
country
));
}
}
}
}
return
super
.
preHandle
(
req
,
resp
,
handler
);
return
super
.
preHandle
(
req
,
resp
,
handler
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment