From 946d8b1a7b428fce61e7b770a76414fcac59e883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Thu, 5 Dec 2024 18:49:45 +0800 Subject: [PATCH] fix: dependencies error --- package.json | 7 +++---- src/webui/src/api/Log.ts | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 3a2cccdb..02ed6662 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "dev:shell": "vite build --mode shell", "dev:webui": "cd napcat.webui && npm run webui:dev", "lint": "eslint --fix src/**/*.{js,ts,vue}", - "depend": "cd dist && npm install --omit=dev" + "depend": "cd dist && npm install --omit=dev", + "dev:depend": "npm i && cd napcat.webui && npm i" }, "devDependencies": { "@babel/preset-typescript": "^7.24.7", @@ -52,13 +53,11 @@ "winston": "^3.17.0" }, "dependencies": { - "event-source-polyfill": "^1.0.31", "express": "^5.0.0", "fluent-ffmpeg": "^2.1.2", "piscina": "^4.7.0", "qrcode-terminal": "^0.12.0", "silk-wasm": "^3.6.1", - "tdesign-icons-vue-next": "^0.3.3", "ws": "^8.18.0" } -} +} \ No newline at end of file diff --git a/src/webui/src/api/Log.ts b/src/webui/src/api/Log.ts index 28dde732..86cee108 100644 --- a/src/webui/src/api/Log.ts +++ b/src/webui/src/api/Log.ts @@ -19,13 +19,12 @@ export const LogListHandler: RequestHandler = async (_, res) => { return sendSuccess(res, logList); }; // 实时日志(SSE) -// 实时日志(SSE) export const LogRealTimeHandler: RequestHandler = async (req, res) => { res.setHeader('Content-Type', 'text/event-stream'); res.setHeader('Connection', 'keep-alive'); const listener = (log: string) => { try { - res.write(`data: ${log}\n\n`); + res.write(`${log}\n`); } catch (error) { console.error('向客户端写入日志数据时出错:', error); }