From abb8b32ed3f78638f75d5b91ce04c10618c66319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=80=E6=A2=A6?= <3501646051@qq.com> Date: Sat, 4 Apr 2026 13:38:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=8D=A2=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=209948=20->=2018081=20=E8=A7=A3=E5=86=B3=20W?= =?UTF-8?q?indows=20=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 前端端口改为 18081 - 添加 host: 127.0.0.1 配置 - 更新 CORS 允许新前端地址 - 更新启动/停止脚本 --- WebUI/vite.config.js | 10 ++++++---- app/core/config.py | 2 +- script/start.bat | 4 ++-- script/stop.bat | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/WebUI/vite.config.js b/WebUI/vite.config.js index 8cbc6b4..a04684c 100644 --- a/WebUI/vite.config.js +++ b/WebUI/vite.config.js @@ -5,13 +5,15 @@ import vue from '@vitejs/plugin-vue' export default defineConfig({ plugins: [vue()], server: { - port: 9948, + port: 18081, // 支持 Vue Router 的 history 模式 - historyApiFallback: true + historyApiFallback: true, + host: '127.0.0.1' }, preview: { - port: 9948, - historyApiFallback: true + port: 18081, + historyApiFallback: true, + host: '127.0.0.1' }, build: { rollupOptions: { diff --git a/app/core/config.py b/app/core/config.py index 8a86213..e3445a2 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -44,7 +44,7 @@ class Settings(BaseSettings): plugins_dir: str = "plugins" # CORS 配置 - cors_origins: str = "http://localhost:8080,http://localhost:5173,http://localhost:9948" + cors_origins: str = "http://localhost:8080,http://localhost:5173,http://127.0.0.1:18081,http://localhost:18081" @property def cors_origins_list(self) -> List[str]: diff --git a/script/start.bat b/script/start.bat index 09bf5fd..0fef7c9 100644 --- a/script/start.bat +++ b/script/start.bat @@ -5,7 +5,7 @@ echo. set "ROOT_PATH=%~dp0.." set "BACKEND_PORT=18080" -set "FRONTEND_PORT=9948" +set "FRONTEND_PORT=18081" REM 1. Clean processes on ports echo [1/4] Cleaning old processes... @@ -82,7 +82,7 @@ echo. echo === All services started === echo Backend: http://127.0.0.1:18080 -echo Frontend: http://localhost:9948 +echo Frontend: http://127.0.0.1:18081 echo. echo Press any key to close this window (services will keep running). pause >nul diff --git a/script/stop.bat b/script/stop.bat index 979c09f..7253af5 100644 --- a/script/stop.bat +++ b/script/stop.bat @@ -4,7 +4,7 @@ echo === Stopping ProxyPool Services === echo. set "BACKEND_PORT=18080" -set "FRONTEND_PORT=9948" +set "FRONTEND_PORT=18081" set "STOPPED_COUNT=0" echo [1/2] Stopping processes on ports %BACKEND_PORT% and %FRONTEND_PORT%...