规范配置文件,添加接口鉴权的例外接口配置

This commit is contained in:
64850858
2021-07-06 16:38:31 +08:00
parent b24be12405
commit 0faa593658
11 changed files with 2471 additions and 16568 deletions

View File

@@ -14,6 +14,8 @@ import org.springframework.security.config.annotation.web.configuration.EnableWe
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import java.util.List;
/**
* 配置Spring Security
*/
@@ -85,6 +87,11 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/swagger-resources/**")
.antMatchers("/v3/api-docs/**")
.antMatchers("/js/**");
List<String> interfaceAuthenticationExcludes = userSetup.getInterfaceAuthenticationExcludes();
System.out.println(interfaceAuthenticationExcludes.size());
for (String interfaceAuthenticationExclude : interfaceAuthenticationExcludes) {
web.ignoring().antMatchers(interfaceAuthenticationExclude);
}
}
}