mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 18:28:43 +08:00 
			
		
		
		
	【修复】AI:临时解决 send-stream 被权限拦截 Access Denied 问题
This commit is contained in:
		| @@ -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<AiChatMessageRespVO> | ||||
|     @Operation(summary = "发送消息(流式)", description = "流式返回,响应较快") | ||||
|     @PostMapping(value = "/send-stream", produces = MediaType.TEXT_EVENT_STREAM_VALUE) | ||||
|     @PermitAll // 解决 SSE 最终响应的时候,会被 Access Denied 拦截的问题 | ||||
|     public Flux<AiChatMessageRespVO> sendMessageStream(@Validated @RequestBody AiChatMessageSendStreamReqVO sendReqVO) { | ||||
|         return chatService.chatStream(sendReqVO); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV