diff --git a/WebUI/src/api/index.js b/WebUI/src/api/index.js index ebcb3f0..11dac60 100644 --- a/WebUI/src/api/index.js +++ b/WebUI/src/api/index.js @@ -2,7 +2,7 @@ import axios from 'axios' import { showError } from '../utils/message' /** @type {string} 默认 API 基础 URL */ -export const DEFAULT_API_BASE_URL = 'http://localhost:9949' +export const DEFAULT_API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:18080' /** @type {number} 请求超时时间(毫秒) */ export const REQUEST_TIMEOUT = 30000 diff --git a/app/core/config.py b/app/core/config.py index 6b596a6..8a86213 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -15,7 +15,7 @@ class Settings(BaseSettings): db_path: str = "db/proxies.sqlite" # API 服务配置 - host: str = "0.0.0.0" + host: str = "127.0.0.1" port: int = 9949 # 验证器配置 diff --git a/script/start.bat b/script/start.bat index ef21249..09bf5fd 100644 --- a/script/start.bat +++ b/script/start.bat @@ -4,7 +4,7 @@ echo === ProxyPool Startup === echo. set "ROOT_PATH=%~dp0.." -set "BACKEND_PORT=9949" +set "BACKEND_PORT=18080" set "FRONTEND_PORT=9948" REM 1. Clean processes on ports @@ -53,7 +53,7 @@ ping -n 3 127.0.0.1 >nul 2>&1 set /a RETRY_COUNT+=1 REM Try to connect to backend health endpoint -powershell -Command "try { $r = Invoke-RestMethod -Uri 'http://127.0.0.1:9949/health' -TimeoutSec 2 -ErrorAction Stop; exit 0 } catch { exit 1 }" >nul 2>&1 +powershell -Command "try { $r = Invoke-RestMethod -Uri 'http://127.0.0.1:18080/health' -TimeoutSec 2 -ErrorAction Stop; exit 0 } catch { exit 1 }" >nul 2>&1 if %errorlevel% equ 0 ( set BACKEND_READY=1 goto WAIT_DONE @@ -81,7 +81,7 @@ echo Frontend started echo. echo === All services started === -echo Backend: http://127.0.0.1:9949 +echo Backend: http://127.0.0.1:18080 echo Frontend: http://localhost:9948 echo. echo Press any key to close this window (services will keep running). diff --git a/script/stop.bat b/script/stop.bat index 895a33f..979c09f 100644 --- a/script/stop.bat +++ b/script/stop.bat @@ -3,7 +3,7 @@ chcp 65001 >nul echo === Stopping ProxyPool Services === echo. -set "BACKEND_PORT=9949" +set "BACKEND_PORT=18080" set "FRONTEND_PORT=9948" set "STOPPED_COUNT=0"