新增chat robot 模块跨域

This commit is contained in:
zhouchengrong
2023-07-26 17:04:24 +08:00
parent b6ad019dec
commit f2cca64353
4 changed files with 4 additions and 1 deletions

View File

@@ -46,7 +46,8 @@ public class AuthenticationFilter extends OncePerRequestFilter {
"/api/python/saveGeneratePicture", "/api/python/getLibraryByUserId",
"/api/third/party/addUser","/api/third/party/editUser","/api/element/initDefaultSysFile",
"/api/python/chatStream",
"/api/python/flush");
"/api/python/flush"
);
@Override
protected void doFilterInternal(HttpServletRequest httpServletRequest, @NonNull HttpServletResponse httpServletResponse, @NonNull FilterChain filterChain) throws ServletException, IOException {

View File

@@ -67,6 +67,7 @@ public class PythonController {
Collectors.mapping(PythonLibraryVo::getUrl, Collectors.toList()))));
}
@CrossOrigin
@ApiOperation(value = "发送用户输入消息")
@PostMapping("/chatStream")
public SseEmitter MessageToPythonChatStream(@RequestBody ChatSendDTO chatSendDTO) {
@@ -74,6 +75,7 @@ public class PythonController {
return chatRobotService.sendMessageToChatRobot(chatSendDTO);
}
@CrossOrigin
@ApiOperation(value = "刷新会话缓存")
@PostMapping("/flush")
public Response<String> ChatBufferFlush(@RequestBody ChatFlushDTO chatFlushDTO) {