|
@@ -19,6 +19,7 @@ import org.springframework.security.web.authentication.WebAuthenticationDetailsS
|
|
|
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.Arrays;
|
|
|
|
|
|
/**
|
|
|
* @AUTHOR: DaiFengWen
|
|
@@ -40,6 +41,9 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
@Value("${web.logoutUrl:/logout}")
|
|
|
private String logoutUrl;
|
|
|
|
|
|
+ @Value("${web.permitUrls:/**/*.png}")
|
|
|
+ private String[] permitUrls;
|
|
|
+
|
|
|
@Override
|
|
|
@Bean
|
|
|
public UserDetailsService userDetailsService() { //覆盖写userDetailsService方法 (1)
|
|
@@ -126,8 +130,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|
|
public void configure(WebSecurity web) throws Exception {
|
|
|
web.ignoring().antMatchers("/resources/**", "/static/**", "/**.js");
|
|
|
web.ignoring().antMatchers(uploadProperties.getUploadPattern());
|
|
|
- web.ignoring().antMatchers("/**/*.js", "/lang/*.json", "/**/*.css", "/**/*.map", "/**/*.png", "/**/*.jpg","/**/*.woff","/**/*.ttf");
|
|
|
-// web.ignoring().antMatchers("/fonts/**");
|
|
|
+ web.ignoring().antMatchers("/**/*.js", "/lang/*.json", "/**/*.css", "/**/*.map", "/**/*.png", "/**/*.jpg","/**/*.woff","/**/*.ttf","/*.ico");
|
|
|
+ web.ignoring().antMatchers(permitUrls);
|
|
|
web.ignoring().antMatchers("/open/**");
|
|
|
web.ignoring().antMatchers("/v2/api-docs",//swagger api json
|
|
|
"/swagger-resources/configuration/ui",//用来获取支持的动作
|