fix(packaging): v1.19.2 修复干净 Windows 上 EXE 页面纯黑(MIME 类型)

根因:干净 Windows(无开发环境)注册表里没有 .js 的 Content Type 映射,
mimetypes.guess_type('.js') 返回 None,StaticFiles 回退到 text/plain。
浏览器 <script type="module"> 启用严格 MIME 检查,拒绝执行 text/plain
的 JS → Vue 不挂载 → 页面纯黑(/docs 不受影响因为它是 API 路由)。

修复:mount 前用 mimetypes.add_type 强制注册 .js/.mjs/.css/.svg 的正确
MIME,无论机器装没装开发工具都生效。

同时改 easy_tdx.spec:datas 用 pathlib.rglob 逐文件展开,更可靠。
This commit is contained in:
Justin Gu
2026-07-07 15:18:53 +08:00
parent 957cb8eeb0
commit ecd6e298f5
4 changed files with 43 additions and 3 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "easy-tdx"
version = "1.19.1"
version = "1.19.2"
description = "通达信 TCP 协议行情数据客户端,支持在线行情、离线数据读取与写入同步"
readme = "README.md"
requires-python = ">=3.10"