Sprigsecurityは静的資源css、jsを導入して、ピクチャーは遮られますなどの問題の解決方法


もし解決しないならば、springsecurityは自動的に私達の引用するcss、jsなどの静的な資源を遮って、ページがそのある様式の機能をロードすることができないことを招きます。
WebSecurityConfigrer Adapterクラスを継承したconfigureメソッドにロードを許可するプロファイルを追加すること。
.antMatchers("/js/**","/css/**","/images/*","/fonts/**","/**/*.png","/**/*.jpg").permitAll()
この方法でもいいです。
public void configure(WebSecurity web) throws Exception {
    //   URL
    web.ignoring().antMatchers("/**/*.js", "/lang/*.json", "/**/*.css", "/**/*.js", "/**/*.map", "/**/*.html",
            "/**/*.png");
}
 
これはhtmlページの中でthemleafを通じて引用できます。