add(security): 配置 websocket 路径的匿名访问权限

- 在 SecurityConfig 中添加了对 /websocket/** 路径的 permitAll 配置
- 这允许未登录的用户也能访问 websocket 相关的请求
IOT
zch 2 months ago
parent f6d6778770
commit 5f4160b30f

@ -138,6 +138,9 @@ public class SecurityConfig
// 允许匿名访问 字典类型
.antMatchers("/system/dict/data/type/**").permitAll()
// 如果需要不登录也可以访问,需要在`SecurityConfig.java`中设置匿名访问
.antMatchers("/websocket/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
})

Loading…
Cancel
Save