RuoYi v3.8.7(若依前后端分离版本)放行指定接口地址,不需要登录就可以访问。

注解

控制器方法上加上 @Anonymous 注解,使用这个注解需要引用 ruoyi-common 模块

@Anonymous

修改代码

  • 打开 src/main/java/com/ruoyi/framework/config/SecurityConfig.java 文件
  • 96行 protected void configure(HttpSecurity httpSecurity) throws Exception 方法中
  • 添加自己的 antMatchers
.antMatchers("/exam/train/list").permitAll()
posted @ 2024-04-28 17:24  无上至尊自然妙有弥罗  阅读(732)  评论(0编辑  收藏  举报