From 46641528b907eb71bf0f6478d31850b8f168b988 Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Tue, 30 Sep 2025 17:39:13 +0800 Subject: [PATCH] adsd --- server.js | 1 + src/chat_with_audio.js | 4 ++-- src/config.js | 2 +- src/index.js | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/server.js b/server.js index 9b6702e..e7a9dfc 100644 --- a/server.js +++ b/server.js @@ -9,6 +9,7 @@ const { MessageHistory } = require('./src/message_history.js'); const app = express(); const server = http.createServer(app); const io = socketIo(server, { + path: '/emotion-male-app/socket.io', pingTimeout: 300000, // 60秒超时 pingInterval: 25000, // 25秒心跳间隔 upgradeTimeout: 30000, // 30秒升级超时 diff --git a/src/chat_with_audio.js b/src/chat_with_audio.js index c15d002..bc6397f 100644 --- a/src/chat_with_audio.js +++ b/src/chat_with_audio.js @@ -19,7 +19,7 @@ async function initializeHistoryMessage(recentCount = 5) { if (isInitialized) return historyMessage; try { - const response = await fetch(`/api/messages/for-llm?includeSystem=true&recentCount=${recentCount}`); + const response = await fetch(`/emotion-male-app/api/messages/for-llm?includeSystem=true&recentCount=${recentCount}`); if (!response.ok) { throw new Error('获取历史消息失败'); } @@ -79,7 +79,7 @@ async function saveMessage(userInput, assistantResponse) { return; } - const response = await fetch('/api/messages/save', { + const response = await fetch('/emotion-male-app/api/messages/save', { method: 'POST', headers: { 'Content-Type': 'application/json' diff --git a/src/config.js b/src/config.js index 8aead23..f026e9b 100644 --- a/src/config.js +++ b/src/config.js @@ -81,7 +81,7 @@ export function getLLMConfig(sceneApiKey = null) { // 新增:根据场景获取LLM配置 export async function getLLMConfigByScene() { try { - const response = await fetch('/api/current-scene'); + const response = await fetch('/emotion-male-app/api/current-scene'); const sceneData = await response.json(); return { diff --git a/src/index.js b/src/index.js index b43afae..365a063 100644 --- a/src/index.js +++ b/src/index.js @@ -172,7 +172,9 @@ class WebRTCChat { } initializeSocket() { - this.socket = io(); + this.socket = io({ + path: '/emotion-male-app/socket.io', + }); this.socket.on('connect', () => { this.updateStatus('已连接到服务器', 'connected');