mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化 sse 登录校验 避免大量报错
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user