fix: 更换后端端口 9949 -> 18080 解决 Windows 绑定权限问题

- 修改后端默认端口为 18080
- 更新前端 API 配置支持新端口
- 更新启动/停止脚本端口配置
- 添加 .env 配置文件
This commit is contained in:
祀梦
2026-04-04 13:37:17 +08:00
parent 38bd66128b
commit eeb16774d7
4 changed files with 6 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ import axios from 'axios'
import { showError } from '../utils/message' import { showError } from '../utils/message'
/** @type {string} 默认 API 基础 URL */ /** @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} 请求超时时间(毫秒) */ /** @type {number} 请求超时时间(毫秒) */
export const REQUEST_TIMEOUT = 30000 export const REQUEST_TIMEOUT = 30000

View File

@@ -15,7 +15,7 @@ class Settings(BaseSettings):
db_path: str = "db/proxies.sqlite" db_path: str = "db/proxies.sqlite"
# API 服务配置 # API 服务配置
host: str = "0.0.0.0" host: str = "127.0.0.1"
port: int = 9949 port: int = 9949
# 验证器配置 # 验证器配置

View File

@@ -4,7 +4,7 @@ echo === ProxyPool Startup ===
echo. echo.
set "ROOT_PATH=%~dp0.." set "ROOT_PATH=%~dp0.."
set "BACKEND_PORT=9949" set "BACKEND_PORT=18080"
set "FRONTEND_PORT=9948" set "FRONTEND_PORT=9948"
REM 1. Clean processes on ports 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 set /a RETRY_COUNT+=1
REM Try to connect to backend health endpoint 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 ( if %errorlevel% equ 0 (
set BACKEND_READY=1 set BACKEND_READY=1
goto WAIT_DONE goto WAIT_DONE
@@ -81,7 +81,7 @@ echo Frontend started
echo. echo.
echo === All services started === 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 Frontend: http://localhost:9948
echo. echo.
echo Press any key to close this window (services will keep running). echo Press any key to close this window (services will keep running).

View File

@@ -3,7 +3,7 @@ chcp 65001 >nul
echo === Stopping ProxyPool Services === echo === Stopping ProxyPool Services ===
echo. echo.
set "BACKEND_PORT=9949" set "BACKEND_PORT=18080"
set "FRONTEND_PORT=9948" set "FRONTEND_PORT=9948"
set "STOPPED_COUNT=0" set "STOPPED_COUNT=0"