Skip to content

修复:稳定 Windows 与 Alter 本地启动 - #31

Merged
damingishere-coder merged 3 commits into
mainfrom
fix/windows-startup
Aug 22, 2026
Merged

修复:稳定 Windows 与 Alter 本地启动#31
damingishere-coder merged 3 commits into
mainfrom
fix/windows-startup

Conversation

@damingishere-coder

@damingishere-coder damingishere-coder commented Aug 3, 2026

Copy link
Copy Markdown
Owner

修改内容

  • 新增 scripts/run_frontend.ps1scripts/run_backend.ps1,让 Alter 分别以前台方式托管两个组件。
  • 前端直接运行项目内 Next.js CLI,避免命令包装层停止后遗留占用 6866 的子进程。
  • 后端启动默认不打开管理页,也不预先初始化 Playwright;招聘平台浏览器改为真正使用功能时按需启动。
  • Alter 场景关闭后端附加的 6866 静态端口,消除前后端端口竞争。
  • Windows 启动器改用 HTTP 健康检查,并校验端口属于当前项目;错误时给出占用进程信息。
  • 修正文档中的项目路径并补充 Alter 前后端配置。

根因

  • Alter 原先登记的是旧目录,且通过命令包装层启动 Next.js;包装层停止后,子进程可能仍占用 6866,导致新前端启动失败、网页无法访问。
  • 后端启动时无条件初始化 Playwright,会立即创建并导航 Boss、智联、猎聘和 51job 页面。
  • 后端静态服务可能在前端未就绪时抢占 6866。

验证

  • 后端定向测试:5/5 通过。
  • 后端全量测试:88 项,86 通过、2 跳过、0 失败。
  • 前端 corepack pnpm@10.20.0 --dir front build:通过,13/13 页面生成成功。
  • Windows PowerShell 5.1 语法解析:两个 Alter 脚本均通过。
  • Alter 整组停止后 6866/7866/8888 全部释放;重新启动后前端与后端均为 running。
  • http://127.0.0.1:6866/:HTTP 200,页面实际加载且无控制台错误。
  • http://127.0.0.1:8888/api/health:HTTP 200,状态 UP,浏览器自动化未初始化。
  • 未发现该项目创建的 Chrome/Playwright 进程,7866 无监听。
  • git diff --check:通过。

@damingishere-coder damingishere-coder changed the title 修复:Windows 启动脚本端口冲突 修复:稳定 Windows 与 Alter 本地启动 Aug 22, 2026
@damingishere-coder
damingishere-coder marked this pull request as ready for review August 22, 2026 04:50
@damingishere-coder
damingishere-coder merged commit 49e7e44 into main Aug 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant