代码调整
This commit is contained in:
@@ -48,8 +48,11 @@ public class CaptchaTokenGranter extends AbstractTokenGranter {
|
|||||||
Map<String, String> parameters = new LinkedHashMap<>(tokenRequest.getRequestParameters());
|
Map<String, String> parameters = new LinkedHashMap<>(tokenRequest.getRequestParameters());
|
||||||
String username = parameters.get(SecurityConstants.USERNAME);
|
String username = parameters.get(SecurityConstants.USERNAME);
|
||||||
username = DesUtils.aesDecrypt(username);
|
username = DesUtils.aesDecrypt(username);
|
||||||
if (!judgeImageCode(parameters.get(SecurityConstants.IMAGE_CODE), RequestUtil.getRequest())) {
|
String verifyCode = parameters.get(SecurityConstants.VERIFY_CODE);
|
||||||
throw new BusinessException(UserResponseEnum.LOGIN_WRONG_CODE);
|
if(StrUtil.isEmpty(verifyCode)||verifyCode.equals("1")){
|
||||||
|
if (!judgeImageCode(parameters.get(SecurityConstants.IMAGE_CODE), RequestUtil.getRequest())) {
|
||||||
|
throw new BusinessException(UserResponseEnum.LOGIN_WRONG_CODE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
String password = parameters.get(SecurityConstants.PASSWORD);
|
String password = parameters.get(SecurityConstants.PASSWORD);
|
||||||
String ip = RequestUtil.getRequest().getHeader(SecurityConstants.REQUEST_HEADER_KEY_CLIENT_REAL_IP);
|
String ip = RequestUtil.getRequest().getHeader(SecurityConstants.REQUEST_HEADER_KEY_CLIENT_REAL_IP);
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ public interface SecurityConstants {
|
|||||||
String USERNAME = "username";
|
String USERNAME = "username";
|
||||||
String PASSWORD = "password";
|
String PASSWORD = "password";
|
||||||
String IMAGE_CODE = "imageCode";
|
String IMAGE_CODE = "imageCode";
|
||||||
|
String VERIFY_CODE = "verifyCode";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user