From bd23a91a58f13841118feebd461b8d1b8d38ffe5 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 28 Aug 2025 19:53:27 +0800 Subject: [PATCH] 's' --- frontend/package.json | 2 +- frontend/src/components/files/ListingItem.vue | 7 +++++-- frontend/vite.config.ts | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 680232c..ec8c9ba 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,7 +8,7 @@ "pnpm": ">=9.0.0" }, "scripts": { - "dev": "vite dev", + "dev": "vite dev --host 0.0.0.0", "build": "pnpm run typecheck && vite build", "clean": "find ./dist -maxdepth 1 -mindepth 1 ! -name '.gitkeep' -exec rm -r {} +", "typecheck": "vue-tsc -p ./tsconfig.tsc.json --noEmit", diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 08cfb5c..459816f 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -379,7 +379,9 @@ const stopLive = async () => { const thread_id = props.url.replace(/\//g, "_"); // 调用 FastAPI 停止接口 - const res = await fetch("http://live.local:8700/stop_live", { + // const res = await fetch("http://live.local:8700/stop_live", { + const res = await fetch("http://localhost:8700/stop_live", { + method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ thread_id }) // 如果想停止全部可以 body: {} @@ -407,7 +409,8 @@ const startLive = async () => { console.log('file_path',file_path) // 调用 FastAPI 后端接口 - const res = await fetch("http://live.local:8700/start_live", { + // const res = await fetch("http://live.local:8700/start_live", { + const res = await fetch("http://localhost:8700/start_live", { // const res = await fetch("http://192.168.31.245:8700/start_live", { method: "POST", diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 9323b63..7c608ff 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -41,11 +41,14 @@ export default defineConfig(({ command }) => { proxy: { // Zero3 后端 WebSocket(如果你有 ws 接口) "/api/command": { - target: "ws://live.local:8081", + // target: "ws://live.local:8081", + target: "ws://localhost:8081", ws: true, }, // Zero3 后端 HTTP - "/api": "http://live.local:8081", + // "/api": "http://live.local:8081", + "/api": "http://localhost:8081", + }, }, };