スプリングブート統合スプリングセキュリティアクセスインターフェイスが応答しない

状態:

ブラウザを介してアクセス要求を送信します。

localhost:9000 / files / downloadここに写真の説明を挿入

ユーザーとパスワードを入力してください

ここに写真の説明を挿入

パスワードが設定されていない場合、コンソールには

生成されたセキュリティパスワードの使用:75a2959a-522c-4335-830d-d247e7b4743b

普通に訪問します

ここに写真の説明を挿入

解決

@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
    
    

    @Override
    public void configure(WebSecurity web) throws Exception {
    
    
        //忽略权限授权接口,填写路径就好
        web.ignoring().antMatchers("/sysUsers/*", "/auth/*", "/files/*");
    }

//    @Override
//    public void configure(HttpSecurity http) throws Exception {
    
    
////         任意请求允许无授权访问
//        http.authorizeRequests()
//                .anyRequest().permitAll();
////        http.csrf().disable().exceptionHandling().authenticationEntryPoint(getAccessDeniedHandler());
//    }
}

おすすめ

転載: blog.csdn.net/weixin_42096620/article/details/111525729