Commit 1f69863f by WeiCong

修复验证码缺陷和增加日志打印

parent 9cd8f443
...@@ -199,6 +199,7 @@ public class DatabaseLoginContextForELCS extends AbstractLoginContext { ...@@ -199,6 +199,7 @@ public class DatabaseLoginContextForELCS extends AbstractLoginContext {
return setLogon(true, userName, null, "游客成功登录.", stmt, rs); return setLogon(true, userName, null, "游客成功登录.", stmt, rs);
} }
if(sendcode==null || verifycode==null || !sendcode.equalsIgnoreCase(verifycode)){ if(sendcode==null || verifycode==null || !sendcode.equalsIgnoreCase(verifycode)){
log.info("验证码验证失败,待校验:"+sendcode+",原始:"+verifycode);
parameterMap.put(ERROR, ErrorCode.LOGIN_VERIFYCODE_ERROR); parameterMap.put(ERROR, ErrorCode.LOGIN_VERIFYCODE_ERROR);
return setLogon(false, userName, ErrorCode.LOGIN_VERIFYCODE_ERROR.getCode(), ErrorCode.LOGIN_VERIFYCODE_ERROR.getMessage(), stmt, rs); return setLogon(false, userName, ErrorCode.LOGIN_VERIFYCODE_ERROR.getCode(), ErrorCode.LOGIN_VERIFYCODE_ERROR.getMessage(), stmt, rs);
} }
......
...@@ -50,7 +50,7 @@ public class LoginController { ...@@ -50,7 +50,7 @@ public class LoginController {
String password = noUiRequest.getDataMap().get(Constants.PASSWORD).toString(); String password = noUiRequest.getDataMap().get(Constants.PASSWORD).toString();
String dncode = noUiRequest.getDataMap().get(Constants.DNCODE)==null?null:noUiRequest.getDataMap().get(Constants.DNCODE).toString(); String dncode = noUiRequest.getDataMap().get(Constants.DNCODE)==null?null:noUiRequest.getDataMap().get(Constants.DNCODE).toString();
String sendcode = noUiRequest.getDataMap().get(Constants.SENDCODE)==null?null:noUiRequest.getDataMap().get(Constants.SENDCODE).toString(); String sendcode = noUiRequest.getDataMap().get(Constants.SENDCODE)==null?null:noUiRequest.getDataMap().get(Constants.SENDCODE).toString();
String verifycode = session.getAttribute(Constants.VERIFYCODE)==null?null:session.getAttribute(Constants.VERIFYCODE).toString(); String verifycode = request.getSession().getAttribute(Constants.VERIFYCODE)==null?null:request.getSession().getAttribute(Constants.VERIFYCODE).toString();
map.put("j_username", userId); map.put("j_username", userId);
map.put("j_password", password); map.put("j_password", password);
map.put("j_dncode", dncode); map.put("j_dncode", dncode);
...@@ -93,13 +93,10 @@ public class LoginController { ...@@ -93,13 +93,10 @@ public class LoginController {
return ResultUtil.result(ErrorCodes.SUCCESS, ErrorCodes.SUCCESS_INFO, retDatamap, noUiVersion.getVersion()); return ResultUtil.result(ErrorCodes.SUCCESS, ErrorCodes.SUCCESS_INFO, retDatamap, noUiVersion.getVersion());
}else { }else {
ErrorCode errorCode = (ErrorCode) o; ErrorCode errorCode = (ErrorCode) o;
log.error(errorCode);
return ResultUtil.result(errorCode.getCode(), errorCode.getMessage(), retDatamap, noUiVersion.getVersion()); return ResultUtil.result(errorCode.getCode(), errorCode.getMessage(), retDatamap, noUiVersion.getVersion());
} }
}else { }else {
final ErrorCode errorCode = (ErrorCode) map.get(ERROR); final ErrorCode errorCode = (ErrorCode) map.get(ERROR);
log.error(errorCode);
session.removeAttribute(Constants.VERIFYCODE);
return ResultUtil.result(errorCode.getCode(), errorCode.getMessage(), null, noUiVersion.getVersion()); return ResultUtil.result(errorCode.getCode(), errorCode.getMessage(), null, noUiVersion.getVersion());
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -38,6 +38,7 @@ public class NoUiUtils { ...@@ -38,6 +38,7 @@ public class NoUiUtils {
public static IFilter passwordFilter; public static IFilter passwordFilter;
public static boolean connectKeeped; public static boolean connectKeeped;
public static String serviceDbName; public static String serviceDbName;
public static int STP=50;
private static final ThreadGroup threadGroup = new ThreadGroup("eIBS"); private static final ThreadGroup threadGroup = new ThreadGroup("eIBS");
......
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