From 545848844ccb761f2c775b9f3b191351f675b15d Mon Sep 17 00:00:00 2001 From: Song367 <601337784@qq.com> Date: Tue, 30 Sep 2025 17:32:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 1 - src/index.html | 2 +- src/index.js | 12 +++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/server.js b/server.js index e7a9dfc..9b6702e 100644 --- a/server.js +++ b/server.js @@ -9,7 +9,6 @@ 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/index.html b/src/index.html index 310098f..e3eea82 100644 --- a/src/index.html +++ b/src/index.html @@ -532,7 +532,7 @@ - + diff --git a/src/index.js b/src/index.js index 1f3b737..b43afae 100644 --- a/src/index.js +++ b/src/index.js @@ -172,9 +172,7 @@ class WebRTCChat { } initializeSocket() { - this.socket = io({ - path: '/emotion-male-app/socket.io' - }); + this.socket = io(); this.socket.on('connect', () => { this.updateStatus('已连接到服务器', 'connected'); @@ -247,7 +245,7 @@ class WebRTCChat { console.log('开始初始化开场白音频...'); // 获取当前场景的开场白 - const response = await fetch('/api/current-scene/opening-line'); + const response = await fetch('/emotion-male-app/api/current-scene/opening-line'); const data = await response.json(); if (data.success && data.openingLine) { @@ -347,7 +345,7 @@ class WebRTCChat { async loadVideoMapping() { try { - const response = await fetch('/api/video-mapping'); + const response = await fetch('/emotion-male-app/api/video-mapping'); const data = await response.json(); this.videoMapping = data.mapping; this.interactionVideo = data.mapping['8-4-sh']; @@ -360,7 +358,7 @@ class WebRTCChat { async loadDefaultVideo() { try { - const response = await fetch('/api/default-video'); + const response = await fetch('/emotion-male-app/api/default-video'); const data = await response.json(); this.defaultVideo = data.defaultVideo; this.logMessage('默认视频配置加载成功', 'success'); @@ -371,7 +369,7 @@ class WebRTCChat { async loadVideoList() { try { - const response = await fetch('/api/videos'); + const response = await fetch('/emotion-male-app/api/videos'); const data = await response.json(); this.renderVideoList(data.videos); this.logMessage('视频列表加载成功', 'success');