处理问题

This commit is contained in:
wanggeng 2021-08-20 16:34:56 +08:00
parent 9767f49a06
commit 3629a314bf

View File

@ -35,10 +35,13 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private UserLoginService userLoginService;
@Autowired
private PasswordEncoder passwordEncoder;
@Override
protected void configure(HttpSecurity http) throws Exception {
/**
* 默认放行配置
*/
private String[] defaultAntMatchers = {
String[] defaultAntMatchers = {
baseProperties.getLoginUrl(),
baseProperties.getLoginProcess(),
baseProperties.getLoginFailure(),
@ -53,17 +56,15 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
"/api/sms/getverificationcode/*",
"/api/user/getsignintype/**"
};
@Override
protected void configure(HttpSecurity http) throws Exception {
String assetsMatchers = baseProperties.getAssetsMatchers();
String[] fullAntMatchers;
if (!StringUtils.isBlank(assetsMatchers)) {
String[] assetsMatchersArray = baseProperties.getAssetsMatchers().split(",");
fullAntMatchers = ArrayUtils.addAll(defaultAntMatchers, assetsMatchers);
fullAntMatchers = ArrayUtils.addAll(defaultAntMatchers, assetsMatchersArray);
} else {
fullAntMatchers = defaultAntMatchers;
}
LoginFailureHandler loginFailureHandler = new LoginFailureHandler(baseProperties.getLoginFailure());
http
.formLogin()