mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 08:13:44 +08:00 
			
		
		
		
	fix 修复 关闭应用sse销毁报错问题
This commit is contained in:
		@@ -7,6 +7,7 @@ import org.dromara.common.core.domain.R;
 | 
			
		||||
import org.dromara.common.satoken.utils.LoginHelper;
 | 
			
		||||
import org.dromara.common.sse.core.SseEmitterManager;
 | 
			
		||||
import org.dromara.common.sse.dto.SseMessageDto;
 | 
			
		||||
import org.springframework.beans.factory.DisposableBean;
 | 
			
		||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
 | 
			
		||||
import org.springframework.http.MediaType;
 | 
			
		||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
			
		||||
@@ -18,7 +19,7 @@ import java.util.List;
 | 
			
		||||
@RestController
 | 
			
		||||
@ConditionalOnProperty(value = "sse.enabled", havingValue = "true")
 | 
			
		||||
@RequiredArgsConstructor
 | 
			
		||||
public class SseController {
 | 
			
		||||
public class SseController implements DisposableBean {
 | 
			
		||||
 | 
			
		||||
    private final SseEmitterManager sseEmitterManager;
 | 
			
		||||
 | 
			
		||||
@@ -53,4 +54,9 @@ public class SseController {
 | 
			
		||||
        return R.ok();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void destroy() throws Exception {
 | 
			
		||||
        // 销毁时不需要做什么 此方法避免无用操作报错
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user