|
...
|
...
|
@@ -70,6 +70,11 @@ class ChatLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$data = ['message' => $message];
|
|
|
|
$stream = $gptService->get_ai_chat($data); // 获取流
|
|
|
|
// 允许跨域访问
|
|
|
|
header('Access-Control-Allow-Origin: *');
|
|
|
|
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
|
|
|
header('Access-Control-Allow-Headers: Content-Type, Authorization');
|
|
|
|
|
|
|
|
header('Content-Type: text/event-stream');
|
|
|
|
header('Cache-Control: no-cache');
|
|
|
|
header('Connection: keep-alive');
|
...
|
...
|
|