From 4303aa6986b4bfa2c7b3bc028a29de940ea92094 Mon Sep 17 00:00:00 2001 From: HHY Date: Mon, 21 Sep 2026 02:14:53 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20spa=5Ffallback=20JSONResponse=20?= =?UTF-8?q?=E6=9C=AA=E5=AF=BC=E5=85=A5=E4=B8=8E=20JWT=20=E5=AF=86=E9=92=A5?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main.py 补导入 JSONResponse(修复未匹配 /api 路径 500 的 NameError) - 默认 JWT 密钥补足至 32 字节以上(消除 InsecureKeyLengthWarning) --- CHANGELOG | 1 + src/huamenchuang/core/config.py | 2 +- src/huamenchuang/main.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f381757..3f0a131 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ # CHANGELOG +- [2026-09-21 10:50] FIX: 修复 spa_fallback 的 NameError(JSONResponse 未导入导致未匹配 /api 路径 500)与 JWT 密钥长度警告(默认密钥补足 32 字节以上) (Files: src/huamenchuang/main.py, src/huamenchuang/core/config.py) - [2026-09-21 10:55] FEAT: v1.6 组合画布编辑能力增强——①选中单元可视化: 蓝色虚线框+四角手柄+实时尺寸标注(W×H mm); ②精确尺寸编辑: 工具栏 W/H 输入框(选中单元几何按比例缩放, 锚定左下角, 中梃点位同步); ③方向键微调: 1mm/Shift 10mm; ④右侧单元清单点击选中联动画布; selSize 双向同步(画布拖拽/输入框改动均实时刷新) (Files: frontend/src/components/CombineCanvas.vue, frontend/src/views/CombineView.vue) - [2026-09-21 10:30] FEAT: v1.5 3D 门窗开合动画——①扇推断逻辑抽取为共享模块 inferSashGlyphs(types/drawing.ts), 2D 符号与 3D 动画共用; ②WindoorThreed 重写: 每个扇构建独立网格组(玻璃+扇框), 平开扇绕铰链旋转(od 定铰链侧, 门75°/平开32°/双向门40°), 推拉扇沿轨道平移(双扇前后轨交替), 区域归属扇的不再重复渲染静态玻璃; ③开合控制条: 开合度滑杆+自动演示(正弦摆动)+全开/全关, 平滑插值动画; 组合画布 3D 预览自动获得开合能力 (Files: frontend/src/types/drawing.ts, frontend/src/components/WindoorThreed.vue, frontend/src/components/WindoorCanvas.vue) - [2026-09-21 00:40] FEAT: v1.4 旋转编辑+方向核验+双向门符号。①组合画布旋转编辑: 选中单元⟲/⟳90°旋转(绕几何中心, 分割线法向/开向角度同步旋转)与水平镜像, 工具栏按钮+Del删除; Node数学验证(宽高互换/法向转轴/可逆性✓); ②数据方向核验: 以31729(扇上固定下)与31740(裙板下)真实图纸比对, 确认2D渲染Y翻转方向正确(模型+y=屏幕上); ③2D渲染补双向开启门虚线交叉符号(wtf/withTurningFrame) (Files: frontend/src/components/CombineCanvas.vue, frontend/src/components/WindoorCanvas.vue, frontend/src/views/CombineView.vue) diff --git a/src/huamenchuang/core/config.py b/src/huamenchuang/core/config.py index 9ccb099..4e459df 100644 --- a/src/huamenchuang/core/config.py +++ b/src/huamenchuang/core/config.py @@ -11,7 +11,7 @@ class Settings(BaseSettings): app_name: str = "huamenchuang" # 开发默认 SQLite;生产示例: mysql+aiomysql://user:pwd@localhost/hmc database_url: str = _DEFAULT_DB - jwt_secret: str = "change-me-in-production" + jwt_secret: str = "change-me-in-production-please-set-a-long-random-secret-key" jwt_algorithm: str = "HS256" jwt_expire_hours: int = 24 # 套餐/模块开关(code=10086 付费墙语义),key 为模块名 diff --git a/src/huamenchuang/main.py b/src/huamenchuang/main.py index 6904147..9fa772c 100644 --- a/src/huamenchuang/main.py +++ b/src/huamenchuang/main.py @@ -53,7 +53,7 @@ async def health(): app.include_router(api_router) -from fastapi.responses import FileResponse # noqa: E402 +from fastapi.responses import FileResponse, JSONResponse # noqa: E402 # 静态资源:样板平面图(data/windoor-images) _imgdir = Path(__file__).resolve().parents[2] / "data" / "windoor-images"