update 优化 sse 登录校验 避免大量报错
This commit is contained in:
parent
d4e6e70c43
commit
3d9ed1b92f
@ -30,7 +30,9 @@ public class SseController implements DisposableBean {
|
||||
*/
|
||||
@GetMapping(value = "${sse.path}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
public SseEmitter connect() {
|
||||
StpUtil.checkLogin();
|
||||
if (!StpUtil.isLogin()) {
|
||||
return null;
|
||||
}
|
||||
String tokenValue = StpUtil.getTokenValue();
|
||||
Long userId = LoginHelper.getUserId();
|
||||
return sseEmitterManager.connect(userId, tokenValue);
|
||||
|
Loading…
Reference in New Issue
Block a user