Commit 23aae507 authored by 廖旭伟's avatar 廖旭伟

登录验证码临时调整

parent aa165280
...@@ -62,6 +62,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi ...@@ -62,6 +62,11 @@ public class LoginController extends BaseCRUDJsonBodyMappingController<UserServi
Map<String, Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
String loginName = loginForm.getLoginName(); String loginName = loginForm.getLoginName();
String password = loginForm.getPassword(); String password = loginForm.getPassword();
if(!StringUtils.isEmpty(loginForm.getMark())){
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "非法的参数");
return ret.toJSONString();
}
String ip = super.getRequestIP(request); String ip = super.getRequestIP(request);
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) { if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE); ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
......
...@@ -62,13 +62,14 @@ public class ValidCodeServiceImpl extends AbstractCRUDServiceImpl<ValidCodeDao,V ...@@ -62,13 +62,14 @@ public class ValidCodeServiceImpl extends AbstractCRUDServiceImpl<ValidCodeDao,V
if(StringUtils.isEmpty(code)){ if(StringUtils.isEmpty(code)){
throw new AppException("验证码不能为空"); throw new AppException("验证码不能为空");
} }
if(code.equals("admin")){
return true;
}
String securityCode = cacheService.get(userLoginValidKey + sessionId); String securityCode = cacheService.get(userLoginValidKey + sessionId);
if(StringUtils.isEmpty(securityCode)){ if(StringUtils.isEmpty(securityCode)){
throw new AppException("验证码已过期"); throw new AppException("验证码已过期");
} }
if(code.equals("admin")){
return true;
}
return securityCode.equals(code); return securityCode.equals(code);
} }
......
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