@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
//允许那个用户用什么权限的人登录 使用bcrypt加密方式
auth.inMemoryAuthentication().
//添加加密方式
passwordEncoder(new BCryptPasswordEncoder()).withUser("admin")
//对密码进行加密
.password(new BCryptPasswordEncoder().encode("admin")).roles("ADMIN");
//super.configure(auth);
}
springboot2.0以上整合security报There is no PasswordEncoder mapped for the id "null" || Encoded password d
最新推荐文章于 2020-03-26 16:13:53 发布