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

井底那只最大的青蛙 / 2024-04-29 / 原文

注解

控制器方法上加上 @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()