cli更新 -p参数设置端口

This commit is contained in:
xunbu
2025-07-03 21:55:22 +08:00
parent 744f6f9417
commit 12851a3bb0
2 changed files with 20 additions and 4 deletions

View File

@@ -482,8 +482,8 @@ def find_free_port(start_port):
port += 1 # 端口被占用,尝试下一个端口
def run_app():
initial_port = 8010
def run_app(port=8010):
initial_port = port
try:
# 首先检查初始端口是否可用
port = find_free_port(initial_port)