From 6bc1f8d0f949cd3f09d7b4d39f55633eb85f02f7 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 13 May 2024 13:12:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91AI=EF=BC=9A?= =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=A7=A3=E5=86=B3=20send-stream=20=E8=A2=AB?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8B=A6=E6=88=AA=20Access=20Denied=20?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/controller/admin/chat/AiChatMessageController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/AiChatMessageController.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/AiChatMessageController.java index fb0d9f5ad..7a6c1bc12 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/AiChatMessageController.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/chat/AiChatMessageController.java @@ -7,6 +7,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.annotation.Resource; +import jakarta.annotation.security.PermitAll; import lombok.extern.slf4j.Slf4j; import org.springframework.http.MediaType; import org.springframework.validation.annotation.Validated; @@ -37,6 +38,7 @@ public class AiChatMessageController { // TODO @fan:要不要使用 Flux 来返回;可以使用 Flux @Operation(summary = "发送消息(流式)", description = "流式返回,响应较快") @PostMapping(value = "/send-stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE) + @PermitAll // 解决 SSE 最终响应的时候,会被 Access Denied 拦截的问题 public Flux sendMessageStream(@Validated @RequestBody AiChatMessageSendStreamReqVO sendReqVO) { return chatService.chatStream(sendReqVO); }