spring SecurityConfiguration中拦截url

 @Override 
    public void configure(WebSecurity web) throws Exception {
        web.ignoring()
            .antMatchers(HttpMethod.OPTIONS, "/**")
            .antMatchers("/app/**/*.{js,html}")
            .antMatchers("/bower_components/**")
            .antMatchers("/i18n/**")
            .antMatchers("/content/**")
            .antMatchers("/swagger-ui/index.html")
            .antMatchers("/api/register")
            .antMatchers("/api/activate")
            .antMatchers("/api/account/reset_password/init")
            .antMatchers("/api/account/reset_password/finish")
            .antMatchers("/test/**")
            .antMatchers("/api/selfService");
    }

configure中可以添加放行的url,比如js,国际化文件,页面等


版权声明:本文为qq_22327273原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。