fix: 使用服务器绑定地址生成本地访问 URL

- 通过 127.0.0.1 打开 Tasks,避免受到 localhost 旧 Service Worker 和缓存影响
- 更新 Windows 开发服务器文档,使其与实际生成的访问地址一致
This commit is contained in:
eddy
2026-08-01 14:53:27 +08:00
parent f25ab72cb6
commit ebc245da50
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ npm start
#### Windows 开发服务器脚本
Windows 用户可以使用项目根目录下的 `serve.py` 控制本地开发服务器。服务器默认在 `http://localhost:8000/` 提供 `src` 中的静态文件。
Windows 用户可以使用项目根目录下的 `serve.py` 控制本地开发服务器。服务器默认在 `http://127.0.0.1:8000/` 提供 `src` 中的静态文件,并在启动成功后自动使用默认浏览器打开
```bash
# 启动服务器
+1 -1
View File
@@ -80,7 +80,7 @@ def validate_project() -> bool:
def server_url(port: int) -> str:
return f"http://localhost:{port}/"
return f"http://{HOST}:{port}/"
def open_browser(port: int) -> None: