From f9d11e48d12fd1980a931cd6f3d34530c884fb5e Mon Sep 17 00:00:00 2001 From: Hzq <670952964@qq.com> Date: Wed, 15 Sep 2021 10:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=A8=E5=85=A5=20=E6=89=8B=E6=9C=BA?= =?UTF-8?q?=E4=BB=A4=E7=89=8C=E6=8F=90=E4=BE=9B=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pig4cloud/pig/auth/config/WebSecurityConfigurer.java | 6 ++++-- pig-register/src/main/resources/bootstrap.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java index 30baf50c..f8a9c94d 100755 --- a/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java +++ b/pig-auth/src/main/java/com/pig4cloud/pig/auth/config/WebSecurityConfigurer.java @@ -58,8 +58,10 @@ public class WebSecurityConfigurer extends WebSecurityConfigurerAdapter { .anyRequest().authenticated().and().csrf().disable(); } - @Bean - public PhoneAuthenticationProvider phoneAuthenticationProvider() { + /** + * 不要直接使用@Bean注入 会导致默认的提供者无法注入(DaoAuthenticationProvider) + */ + private PhoneAuthenticationProvider phoneAuthenticationProvider() { PhoneAuthenticationProvider phoneAuthenticationProvider = new PhoneAuthenticationProvider(); phoneAuthenticationProvider.setPasswordEncoder(passwordEncoder()); phoneAuthenticationProvider.setUserDetailsService(userDetailsService); diff --git a/pig-register/src/main/resources/bootstrap.yml b/pig-register/src/main/resources/bootstrap.yml index 3ae65f51..c8a20a51 100755 --- a/pig-register/src/main/resources/bootstrap.yml +++ b/pig-register/src/main/resources/bootstrap.yml @@ -8,7 +8,7 @@ db: user: ${MYSQL_USER:root} password: ${MYSQL_PWD:root} 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: