|
@@ -106,6 +106,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
|
.antMatchers("/open/**").permitAll()
|
|
|
// 对于登录login 验证码captchaImage 允许匿名访问
|
|
|
.antMatchers("/login", "/login/noCode","/captchaImage","/login/studentpassword","/login/studentMobileCode","/login/studentMobile").anonymous()
|
|
|
+ .antMatchers("/student/**").hasRole("STUDENT")
|
|
|
.antMatchers(
|
|
|
HttpMethod.GET,
|
|
|
"/*.html",
|
|
@@ -152,9 +153,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
|
DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider();
|
|
|
MobileCodeAuthenticationProvider mobileCodeAuthenticationProvider = new MobileCodeAuthenticationProvider();
|
|
|
// daoAuthenticationProvider.setUserDetailsService(userDetailsService);
|
|
|
-// mobileCodeAuthenticationProvider.setUserDetailsService(userDetailsService);
|
|
|
+ mobileCodeAuthenticationProvider.setUserDetailsService(userDetailsService);
|
|
|
//ProviderManager providerManager = new ProviderManager(Arrays.asList(mobileCodeAuthenticationProvider,daoAuthenticationProvider));
|
|
|
auth.authenticationProvider(mobileCodeAuthenticationProvider);
|
|
|
auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder());
|
|
|
+
|
|
|
}
|
|
|
}
|