class CustomDaoAuthenticationProvider extends DaoAuthenticationProvider {

    @Override
    public void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) {<FILL_FUNCTION_BODY>}
}

        if (authentication.getCredentials() == null) {
            throw new BadCredentialsException("认证错误");
        } else {
            String presentedPassword = authentication.getCredentials().toString();
            if (!this.getPasswordEncoder().matches(presentedPassword, userDetails.getPassword())) {
                throw new BadCredentialsException("帐号或密码错误");
            }
        }
    
<methods>public void <init>() ,public void setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder) ,public void setUserDetailsPasswordService(org.springframework.security.core.userdetails.UserDetailsPasswordService) ,public void setUserDetailsService(org.springframework.security.core.userdetails.UserDetailsService) <variables>private static final java.lang.String USER_NOT_FOUND_PASSWORD,private org.springframework.security.crypto.password.PasswordEncoder passwordEncoder,private org.springframework.security.core.userdetails.UserDetailsPasswordService userDetailsPasswordService,private org.springframework.security.core.userdetails.UserDetailsService userDetailsService,private volatile java.lang.String userNotFoundEncodedPassword