Commit a96fd08b authored by 李健华's avatar 李健华

修改token长度验证-yxm

parent b1829ee8
...@@ -81,10 +81,10 @@ public class PasswordFreeAccessValidateAdvisor { ...@@ -81,10 +81,10 @@ public class PasswordFreeAccessValidateAdvisor {
} }
// 当前请求的Token // 当前请求的Token
String token = request.getHeader(Constants.X_AUTH_TOKEN); String token = request.getHeader(Constants.X_AUTH_TOKEN);
if (StringUtils.length(token) != Constants.TOKEN_LENGTH) { // if (StringUtils.length(token) != Constants.TOKEN_LENGTH) {
log.info("非法请求 - 无效token, token={}, phoneNo={}, userId={}, clientIp={}", token, phoneNo, userId, clientIp); // log.info("非法请求 - 无效token, token={}, phoneNo={}, userId={}, clientIp={}", token, phoneNo, userId, clientIp);
return false; // return false;
} // }
// 当前session // 当前session
SessionStruct session = XyqbSessionContextHolder.getXSessionFromRedis(token); SessionStruct session = XyqbSessionContextHolder.getXSessionFromRedis(token);
......
...@@ -82,7 +82,7 @@ public class SessionServiceImpl implements ISessionService { ...@@ -82,7 +82,7 @@ public class SessionServiceImpl implements ISessionService {
SessionStruct sessionStruct; SessionStruct sessionStruct;
//获取sessionid //获取sessionid
String sessionId = findSessionIdByUserIdLoginProperties(user.getId(), properties); String sessionId = findSessionIdByUserIdLoginProperties(user.getId(), properties);
if (StringUtils.length(sessionId) == Constants.TOKEN_LENGTH) { if (StringUtils.length(sessionId) > 0) {
sessionStruct = findSessionBySessionId(sessionId); sessionStruct = findSessionBySessionId(sessionId);
if (sessionStruct == null) { if (sessionStruct == null) {
sessionStruct = newSession(user, properties); sessionStruct = newSession(user, properties);
......
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