瀏覽代碼

init

master
Lierbao 1 年之前
父節點
當前提交
21de4d76d0
共有 1 個檔案被更改,包括 6 行新增9 行删除
  1. +6
    -9
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthFilter.java

+ 6
- 9
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/password/UsernamePasswordAuthFilter.java 查看文件

@@ -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 {


Loading…
取消
儲存