There is no PasswordEncoder mapped for the id "null"
问题是password 未加密 此处记录报错原因
使用下面方法可以解决该问题
@Bean
public static PasswordEncoder passwordEncoder(){
return NoOpPasswordEncoder.getInstance();
}
也可使用BCrypt加密
@Bean
public BCryptPasswordEncoder passwordEncoder(){
return new BCryptPasswordEncoder();
}

本文记录了一种常见的密码未加密错误:There is no Password Encoder mapped for the id 'null',并提供了两种解决方案。一种是使用NoOpPasswordEncoder进行密码的简单处理,另一种是采用更安全的BCrypt加密方式。
513

被折叠的 条评论
为什么被折叠?



