|
|
@@ -24,6 +24,10 @@ public class UsernamePasswordAuthFilter extends AbstractAuthenticationProcessing |
|
|
|
|
|
|
|
private boolean postOnly = true; |
|
|
|
|
|
|
|
private static final String USERNAME_PARAMETER = "username"; |
|
|
|
private static final String PASSWORD_PARAMETER = "password"; |
|
|
|
|
|
|
|
|
|
|
|
// ~ Constructors |
|
|
|
// =================================================================================================== |
|
|
|
|
|
|
@@ -40,18 +44,11 @@ public class UsernamePasswordAuthFilter extends AbstractAuthenticationProcessing |
|
|
|
if (postOnly && !request.getMethod().equals(HttpMethod.POST.name())) { |
|
|
|
throw new AuthenticationServiceException("请求方法错误"); |
|
|
|
} |
|
|
|
String usernameParameter = "username"; |
|
|
|
String username = request.getParameter(usernameParameter); |
|
|
|
String passwordParameter = "password"; |
|
|
|
String password = request.getParameter(passwordParameter); |
|
|
|
String loginPlatformParameter = "loginPlatform"; |
|
|
|
String loginPlatform = request.getParameter(loginPlatformParameter); |
|
|
|
String username = request.getParameter(USERNAME_PARAMETER); |
|
|
|
String password = request.getParameter(PASSWORD_PARAMETER); |
|
|
|
if (StringUtils.isBlank(username) || StringUtils.isBlank(password)) { |
|
|
|
throw new UsernameNotFoundException("用户名或密码不能为空"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(loginPlatform)) { |
|
|
|
throw new BizException("登录平台类型不能为空"); |
|
|
|
} |
|
|
|
username = username.trim(); |
|
|
|
password = password.trim(); |
|
|
|
try { |
|
|
|