diff --git a/chat.txt b/chat.txt deleted file mode 100644 index 7b0db87..0000000 --- a/chat.txt +++ /dev/null @@ -1,4 +0,0 @@ -127.0.0.1 | 2023-03-08 10:37:47 -Q:你好 -A:你好!有什么我可以帮助你的吗? ----------------- diff --git a/chatlog.php b/chatlog.php new file mode 100644 index 0000000..a30288c --- /dev/null +++ b/chatlog.php @@ -0,0 +1 @@ + diff --git a/index.php b/index.php index e387627..8349fec 100644 --- a/index.php +++ b/index.php @@ -227,6 +227,22 @@ $type = "个人"; } }); + - + \ No newline at end of file diff --git a/stream.php b/stream.php index b86b6d4..be98a2e 100644 --- a/stream.php +++ b/stream.php @@ -108,6 +108,6 @@ foreach ($responsearr as $msg) { $questionarr = json_decode($postData, true); $filecontent = $_SERVER["REMOTE_ADDR"] . " | " . date("Y-m-d H:i:s") . "\n"; $filecontent .= "Q:" . end($questionarr['messages'])['content'] . "\nA:" . trim($answer) . "\n----------------\n"; -$myfile = fopen(__DIR__ . "/chat.txt", "a") or die("Writing file failed."); +$myfile = fopen(__DIR__ . "/chatlog.php", "a") or die("Writing file failed."); fwrite($myfile, $filecontent); fclose($myfile);