Commit Graph

11 Commits

Author SHA1 Message Date
caee27b0d3 主要修复:
海报加载失败根因:html-to-image 给 blob: 底图地址追加缓存参数,导致地址失效。现已关闭该行为。
合成失败后再次点击“重新生成”,会复用已有 AI 底图,只重试浏览器合成和上传,避免重复调用 AI。
增加底图加载、图表超时、导出失败、尺寸越界等分阶段错误提示。
修复计划书 (cid:数字) 字体乱码被误判为正常文本的问题,现在会正确转入 OCR。
增加繁体中文 OCR 运行支持。
补齐 SIUL 文件名中的确定字段,并且不会覆盖正文已识别数据。
增加“首期规划保费/償還至形成基金所需保費”等保费标签识别。
修正 IUL 年龄、保额、退保价值、缴费期、公司信息等字段映射。
LLM 返回空对象或缺字段时不再视为成功。
增加错误利益数值和年龄/保单年度错位校验。
修复依赖版本降级导致 API/Worker 无法启动的风险。
真实计划书复验结果:
产品:Manulife SIUL 3
投保年龄:48 岁
性别:女性
吸烟状态:非吸烟
币种:USD
基本保额:3,000,000
年缴保费:80,060
缴费期:5 年
利益演示:识别到 10 行
验证结果:
后端相关回归测试:91 passed
前端生产构建:通过
API、数据库、Redis、存储、数据表健康检查:全部正常
Celery Worker:已重启并连接 Redis
真实 PDF:确认进入 OCR,不再使用 (cid:...) 乱码
前端构建目录由运行容器挂载,修复已生效
2026-07-31 23:35:45 +08:00
54808e4e90 优化海报前端逻辑页0731-1 2026-07-31 09:50:46 +08:00
6dfd652a57 07-29 修复一版问题PPT 能够上传了 2026-07-29 15:47:50 +08:00
0ffd9dffdf fix(llm): downgrade misleading 'mock mode' warning to debug level
The warning fired at init time when no env var API keys were set,
but the actual config was loaded from the database on first use.
Changed to debug to avoid confusion in logs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 15:52:29 +08:00
e3479f0546 上线阻断问题全部修复
#	问题	修复	文件
1	前端构建失败(引号错误)	size="small type=" → size="small" type="	PosterHistoryPage.vue
2	migrate_014 ORM vs 缺失列	全部改为原始 SQL,不再引用 ORM 模型	migrate_014.py
3	cleanup 字段名错误	output_path → ppt_path	cleanup.py
4	文案生成 case 越权	添加 case.user_id != user_id 校验	poster/service.py
5	存储路径未接通持久化卷	全部改用 get_storage_root()(默认 /app/api/storage/insurance)	config.py, ppt/routes.py, poster/service.py, poster/tasks.py
高风险问题修复
#	问题	修复	文件
6	migrate_019 rollback 撤销成功字段	每个 ALTER 后立即 commit,失败只回滚当前语句	migrate_019.py
7	迁移锁 Windows 不兼容 + 句柄未持久化	全局变量保存锁句柄,支持 Windows msvcrt	api/insurance/db/__init__.py
8	PDF 校验异常时放行	异常返回 False(文件损坏)	security.py
9	健康检查始终返回成功	缺少关键资源时返回 503 + missing 列表	poster/routes.py
10	短密钥掩码泄露原值	≤4 字符返回 ****	ppt_admin_service.py
11	设置无键名白名单	添加 _ALLOWED_SETTING_KEYS 白名单	ppt_admin_service.py
12	容器重启任务永久 stuck	添加 recover_stale_tasks() 启动恢复函数	poster/tasks.py, ppt/parse_worker.py
2026-07-27 13:52:09 +08:00
67b2dac23f slidesConfig 结构错误 — migrate_017 输出改为数组格式,migrate_019 修复历史数据
迁移系统加固 — 加 advisory lock 防并发,失败回滚并中止启动(原来是 catch-and-continue)
安全漏洞 — Settings/History API 权限收紧,API key 返回掩码值,海报 case 所有权校验
依赖缺失 — requirements.txt 补齐 python-pptx/openai/Pillow,Dockerfile 改为统一安装
海报鉴权下载 — 前端全部改用 authenticated blob,不再 window.open 无 token URL
LLM 配置分离 — 海报文案读取 poster_llm_*(不再复用 ppt_llm_*),支持 config namespace
图片生成器 — 兼容 b64_json 和 URL 两种响应格式,追踪 generation_mode/provider/model
种子数据 — 新环境自动获得 2 个海报模板 + 2 个文案模板
2026-07-27 13:21:34 +08:00
48f6388554 0727 PPT加海报功能02修复一个版本 2026-07-27 10:37:00 +08:00
dbe2f9202d feat: support direct LLM provider config with model sync
- Fix _call_provider to support custom providers (OpenAI-compatible
  fallback) instead of raising ValueError for unknown providers
- Add POST /admin/ppt/sync-models endpoint that fetches available
  models from the configured provider's API
- Redesign PptSettingsAdmin UI: replace Dify model dropdown with
  per-provider 'sync models' button + searchable model selector
- Remove dead Dify-specific code (fetchDifyModels, applyDifyModel)
- Update deepseek default model from deepseek-chat to deepseek-v4-pro
- API Key field now always shown (not conditional on non-dify)
2026-07-25 13:45:32 +08:00
3a0f4f6830 feat: support Dify-synced models without separate API key
When a model is selected from Dify, set provider='dify' and call
through Dify Chat API (/v1/chat-messages) using the existing
DIFY_CHAT_APP_API_KEY. No separate API key configuration needed.

- Frontend: hide API Key/Base URL fields when provider is 'dify',
  show 'via Dify, no API key needed' tag
- Backend: add _call_dify() to route through Dify Chat API
- Backend: _try_load_db_config supports dify provider without api_key

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 16:18:59 +08:00
c8e0c0bb1e feat: add model configuration for PPT and poster generation
- PptSettingsAdmin.vue: full settings page with provider/model/API key
  config for PPT extraction, poster copy, and poster image generation
- Backend: GET /insurance/admin/ppt/available-models to fetch models
  from Dify API (falls back to builtin list when unavailable)
- LLM client: read model config from SystemSetting DB with 60s cache,
  priority: database > environment variables > defaults
- ppt-admin-api.ts: add getAvailableModels() method

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 13:46:04 +08:00
4a556a1cc7 0723 PPT功能初步融合 2026-07-23 13:10:50 +08:00