我已经确定了问题....而且非常简单。
更改了以下内容:
@Overrideprotected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource).passwordEnprer(passwordEnprer);}到下面
@Overrideprotected void registerAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.userDetailsService(customUserService).passwordEnprer(passwordEnprer).andjdbcAuthentication().dataSource(dataSource);}从HttpSecurity配置中删除了它。



