注入 手机令牌提供者

This commit is contained in:
Hzq 2021-09-15 10:57:36 +08:00
parent a3d6182c18
commit f9d11e48d1
2 changed files with 5 additions and 3 deletions

View File

@ -58,8 +58,10 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter {
.anyRequest().authenticated().and().csrf().disable(); .anyRequest().authenticated().and().csrf().disable();
} }
@Bean /**
public PhoneAuthenticationProvider phoneAuthenticationProvider() { * 不要直接使用@Bean注入 会导致默认的提供者无法注入DaoAuthenticationProvider
*/
private PhoneAuthenticationProvider phoneAuthenticationProvider() {
PhoneAuthenticationProvider phoneAuthenticationProvider = new PhoneAuthenticationProvider(); PhoneAuthenticationProvider phoneAuthenticationProvider = new PhoneAuthenticationProvider();
phoneAuthenticationProvider.setPasswordEncoder(passwordEncoder()); phoneAuthenticationProvider.setPasswordEncoder(passwordEncoder());
phoneAuthenticationProvider.setUserDetailsService(userDetailsService); phoneAuthenticationProvider.setUserDetailsService(userDetailsService);

View File

@ -8,7 +8,7 @@ db:
user: ${MYSQL_USER:root} user: ${MYSQL_USER:root}
password: ${MYSQL_PWD:root} password: ${MYSQL_PWD:root}
url: url:
0: jdbc:mysql://${MYSQL_HOST:pig-mysql}:${MYSQL_PORT:3333}/${MYSQL_DB:pig_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true 0: jdbc:mysql://${MYSQL_HOST:pig-mysql}:${MYSQL_PORT:3306}/${MYSQL_DB:pig_config}?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
nacos: nacos: