Closed topcss closed 1 year ago
我解决了,重写了这个类。
package com.plexpt.chatgpt.util;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import java.nio.charset.Charset;
public final class SseHelper {
public static void complete(SseEmitter sseEmitter) {
try {
sseEmitter.complete();
} catch (Exception var2) {
}
}
public static void send(SseEmitter sseEmitter, Object data) {
try {
if (data == null) {
sseEmitter.send("\n");
} else {
sseEmitter.send(data.toString().getBytes(Charset.forName("UTF-8")));
}
} catch (Exception var3) {
}
}
private SseHelper() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
}
}
我用的这段代码。 `
`