clever-framework-security-jwt/src/main/java/io/github/toquery/framework/security/jwt/rest/JwtAuthenticationRest.java
private Authentication authenticate(String username, String password) throws AppSecurityJwtException {
        Objects.requireNonNull(username);
        Objects.requireNonNull(password);

        try {
            Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password));
            if (SecurityContextHolder.getContext().getAuthentication() == null) {
                SecurityContextHolder.getContext().setAuthentication(authentication);
            }
            return authentication;
        } catch (DisabledException e) {
            sysLogService.insertSysLog(null, "系统", "登录失败", null, username, null);
            throw new AppSecurityJwtException("User is disabled!", e);
        } catch (BadCredentialsException e) {
            sysLogService.insertSysLog(null, "系统", "登录失败", null, username + "密码错误", null);
            throw new AppSecurityJwtException("用户名或密码错误！", e, HttpStatus.BAD_REQUEST);
        }
    }
/**
     * Authenticates the user. If something is wrong, an {@link AppSecurityJwtException} will be thrown
     */
Authenticates the user. If something is wrong, an  AppSecurityJwtException will be thrown
Authenticates the user . If something is wrong an AppSecurityJwtException will be thrown
private Authentication authenticate(String username, String password) throws AppSecurityJwtException {
        Objects.requireNonNull(username);
        Objects.requireNonNull(password);
        try {
            Authentication authentication = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password));
            if (SecurityContextHolder.getContext().getAuthentication() == null) {
                SecurityContextHolder.getContext().setAuthentication(authentication);
            }
            return authentication;
        } catch (DisabledException e) {
            sysLogService.insertSysLog(null, "系统", "登录失败", null, username, null);
            throw new AppSecurityJwtException("User is disabled!", e);
        } catch (BadCredentialsException e) {
            sysLogService.insertSysLog(null, "系统", "登录失败", null, username + "密码错误", null);
            throw new AppSecurityJwtException("用户名或密码错误！", e, HttpStatus.BAD_REQUEST);
        }
    }
private Authentication authenticate ( String username , String password ) throws AppSecurityJwtException { Objects . requireNonNull ( username ) ; Objects . requireNonNull ( password ) ; try { Authentication authentication = authenticationManager . authenticate ( new UsernamePasswordAuthenticationToken ( username , password ) ) ; if ( SecurityContextHolder . getContext ( ) . getAuthentication ( ) == null ) { SecurityContextHolder . getContext ( ) . setAuthentication ( authentication ) ; } return authentication ; } catch ( DisabledException e ) { sysLogService . insertSysLog ( null , "系统", "登 录 败", null, user n me,  n ll); throw new AppSecurityJwtException ( "User is disabled!" , e ) ; } catch ( BadCredentialsException e ) { sysLogService . insertSysLog ( null , "系统", "登 录 败", null, user n me + 密码错误", n l ); throw new AppSecurityJwtException ( "用户名或密码错误！", e, HttpStatus.BA D R E UEST); } }
Authenticates the user.
Authenticates the user .