feat: satoken修改

This commit is contained in:
2026-06-23 10:14:14 +08:00
parent 4c3e3717eb
commit d63ce3326b
3 changed files with 22 additions and 4 deletions

View File

@@ -25,6 +25,9 @@ import java.util.concurrent.TimeUnit;
*
* 提供 GET /sse/subscribe 端点,建立持久化 SSE 连接。
* 连接成功后立即发送 connected 事件确认握手,之后每 30 秒发送心跳保活。
*
* 鉴权由 SaTokenConfigure 拦截器统一处理,前端通过 fetch-event-source
* 的 headers 传 saToken401 时由前端 err.response.status 直接读取。
*/
@Slf4j
@RestController
@@ -37,7 +40,7 @@ public class SseController {
/**
* 建立 SSE 订阅连接
*
* 需要登录鉴权Sa-Token 通过 Cookie 自动校验EventSource 同域请求自动携带)
* 鉴权由拦截器处理,此处直接获取登录用户 ID
*
* @return SseEmitter 实例30 分钟超时)
*/