From ebc245da50bf4043a0670b539a1f6236b1e6bc75 Mon Sep 17 00:00:00 2001 From: eddy Date: Sat, 1 Aug 2026 02:38:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E7=BB=91=E5=AE=9A=E5=9C=B0=E5=9D=80=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E8=AE=BF=E9=97=AE=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 通过 127.0.0.1 打开 Tasks,避免受到 localhost 旧 Service Worker 和缓存影响 - 更新 Windows 开发服务器文档,使其与实际生成的访问地址一致 --- README.md | 2 +- serve.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f02f12..647fbbe 100644 --- a/README.md +++ b/README.md @@ -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 # 启动服务器 diff --git a/serve.py b/serve.py index 317f464..5ea5a10 100644 --- a/serve.py +++ b/serve.py @@ -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: