Commit 474615dc by 陶光胜

init

parent 1b8aa263
......@@ -18,17 +18,19 @@ public class UserDetailUtils {
HttpServletRequest request = RequestThreadLocal.get();
if (request != null){
Cookie[] cookies = request.getCookies();
String token = null;
for (Cookie cookie : cookies) {
if (Constants.USER_TOKEN.equals(cookie.getName())) {
token = cookie.getValue();
break;
if(cookies != null){
String token = null;
for (Cookie cookie : cookies) {
if (Constants.USER_TOKEN.equals(cookie.getName())) {
token = cookie.getValue();
break;
}
}
String key = Constants.TOKEN_KEY+token;
Object cache = RedisUtil.getCache(key);
if(cache != null){
return (UserDetail) cache;
}
}
String key = Constants.TOKEN_KEY+token;
Object cache = RedisUtil.getCache(key);
if(cache != null){
return (UserDetail) cache;
}
}
return new UserDetail();
......
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