修复:Windows 启动脚本端口冲突 - #31
Draft
damingishere-coder wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改内容
start_windows.ps1增加 UTF-8 BOM,确保 Windows PowerShell 5.1 正确解析中文脚本。根因
原脚本是无 BOM 的 UTF-8 文件,Windows PowerShell 5.1 会按本地代码页读取,中文字符串可能破坏语法。同时原流程先启动后端、固定等待 3 秒后再启动前端,后端检测不到尚未就绪的前端时会尝试绑定 6866,形成端口竞争。
用户影响
双击
start_windows.bat或运行start_windows.ps1时,启动过程可重复执行;脚本会等待实际端口就绪,并避免前后端互相抢占端口。验证
powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\start_windows.ps1:通过,能识别并跳过已运行的 6866/8888 服务。http://127.0.0.1:6866/env-config:HTTP 200。http://127.0.0.1:8888/api/health:HTTP 200(浏览器自动化模块状态由运行时页面进程决定)。git diff --check:通过。