项目用登录输入正确的用户名和密码为什么还是告知,用户名和密码是不正确?
有这几种情况
第一种是不是开启缓存,数据库中存储的是加密后的密码
第二种,查看源代码,这句是关键,presentedPassword是明文密码,userDetails.getPassword()是加密后的密码,进行比较

this.passwordEncoder.matches(presentedPassword, userDetails.getPassword())
protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException {
 
         if (authentication.getCredentials() == null) {
 
             this.logger.debug("Authentication failed: no credentials provided");
             throw new BadCredentialsException(this.messages.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credenti












![[论文阅读72]Parameter-Efficient Transfer Learning for NLP](https://img-blog.csdnimg.cn/img_convert/304a147bc5561db67d63e09b31a605f0.png)



