fix 修复 登出后重新登录 sse推送报错问题

2.X
疯狂的狮子Li 6 months ago
parent 85d85e90ee
commit 9a28dff2fc

@ -1,5 +1,6 @@
package org.dromara.common.sse.controller;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.dev33.satoken.stp.StpUtil;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
@ -26,6 +27,7 @@ public class SseController {
return sseEmitterManager.connect(userId, tokenValue);
}
@SaIgnore
@GetMapping(value = "${sse.path}/close")
public R<Void> close() {
String tokenValue = StpUtil.getTokenValue();

@ -73,7 +73,6 @@ public class SseEmitterManager {
try {
entry.getValue().send(SseEmitter.event()
.name("message")
.reconnectTime(-1L)
.data(message));
} catch (Exception e) {
emitters.remove(entry.getKey());

Loading…
Cancel
Save