Commit 2b49ae56 by 张乐 Committed by GitHub

Merge pull request #754 from nobodyiam/fix-table-case

fix table case
parents 88494d7d de034352
...@@ -211,10 +211,20 @@ public class AuthConfiguration { ...@@ -211,10 +211,20 @@ public class AuthConfiguration {
@Bean @Bean
public JdbcUserDetailsManager jdbcUserDetailsManager(AuthenticationManagerBuilder auth, DataSource datasource) throws Exception { public JdbcUserDetailsManager jdbcUserDetailsManager(AuthenticationManagerBuilder auth, DataSource datasource) throws Exception {
return auth.jdbcAuthentication().passwordEncoder(new BCryptPasswordEncoder()).dataSource(datasource) JdbcUserDetailsManager jdbcUserDetailsManager = auth.jdbcAuthentication().passwordEncoder(new BCryptPasswordEncoder()).dataSource(datasource)
.usersByUsernameQuery("select Username,Password,Enabled from `Users` where Username=?") .usersByUsernameQuery("select Username,Password,Enabled from `Users` where Username = ?")
.authoritiesByUsernameQuery("select Username,Authority from `Authorities` where Username = ?") .authoritiesByUsernameQuery("select Username,Authority from `Authorities` where Username = ?")
.getUserDetailsService(); .getUserDetailsService();
jdbcUserDetailsManager.setUserExistsSql("select Username from `Users` where Username = ?");
jdbcUserDetailsManager.setCreateUserSql("insert into `Users` (Username, Password, Enabled) values (?,?,?)");
jdbcUserDetailsManager.setUpdateUserSql("update `Users` set Password = ?, Enabled = ? where Username = ?");
jdbcUserDetailsManager.setDeleteUserSql("delete from `Users` where Username = ?");
jdbcUserDetailsManager.setCreateAuthoritySql("insert into `Authorities` (Username, Authority) values (?,?)");
jdbcUserDetailsManager.setDeleteUserAuthoritiesSql("delete from `Authorities` where Username = ?");
jdbcUserDetailsManager.setChangePasswordSql("update `Users` set Password = ? where Username = ?");
return jdbcUserDetailsManager;
} }
@Bean @Bean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment