qq_41908367 2021-12-24 13:46 采纳率: 90.4%
浏览 41
已结题

请问spring security怎么放行

我想写个小项目 用springboot 然后输入地址和端口号:localhost:8080 就会自动跳转到index.html页。
加了spring security该怎么方行这个呢?http.authorizeRequests()
.antMatchers(“/index.html”).permitAll()
.anyRequest().authenticated();
或者
http.authorizeRequests()
.antMatchers(“/indexl”).permitAll()
.anyRequest().authenticated();
都没什么用。

  • 写回答

2条回答 默认 最新

  • 「已注销」 2021-12-24 16:11
    关注

    你没有对 "/" 路径放行

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 1月1日
  • 已采纳回答 12月24日
  • 创建了问题 12月24日