10 Commits

Author SHA1 Message Date
seaislee1209
13440f2709 feat: v0.19.2 prompt 里 @素材名 按火山规范转为「图片N/视频N/音频N」
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 5m58s
火山 Seedance 模型只能理解"素材类型+序号"的指代(官方文档 FAQ Q3);
对文件名 / asset id / URL 类字符串一律读不懂,只能按 content 数组里
图片出现顺序瞎猜谁是谁,导致用户看到的"人物颠倒"概率性现象(典型
任务 cgt-20260422163517-4k8x6)。

改动
- backend/apps/generation/views.py:
  - 新增 _format_prompt_for_ark(prompt, label_placeholders) helper
    用 str.replace 避 regex 元字符崩溃, 按 label 长度降序防子串吞噬
  - video_generate_view references 循环同步维护 image_n/video_n/audio_n
    三个独立计数器 + label_to_placeholder 映射
  - 关键不变量: 任意时刻 counter == content_items 里该类型 *_url 已 push 数
    group 老路径 counter 照推但不登记 label + WARNING, 避免编号错位
  - 调 create_task 前构造 api_prompt 传给火山, DB.prompt 保留用户原文
    (带 @xxx.jpg) 以便 reEdit 重建带缩略图标签

测试覆盖 14 项 (airlabs-test MySQL 全绿)
- 单元 9 项: 基础替换 / 多类型独立计数 / 重复 @ / 子串冲突 / 正则元字符 /
  空 mapping / label 未 @ / 中文标点 / 空 label 跳过
- 集成 5 项: local 正常替换 / DB 原文保留 / group 老路径不换 + WARN /
  混用 local+group counter 对齐 (关键回归) / 图片音频独立计数

兼容性
- reEdit: DB 保留原文, PromptInput.rebuildMentionSpans 按 @label 正则
  仍能重建 span, 缩略图正常
- regenerate: 走同一 POST /api/v1/video/generate, 二次过转换
- Celery: 只 query 不重发, 不受影响

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:52:32 +08:00
zyc
a389495ee7 add change host
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m21s
2026-03-20 16:25:22 +08:00
seaislee1209
6a0311d599 fix: LoginRecord 创建时显式传 geo 空字段,修复 MySQL 严格模式 IntegrityError
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m24s
MySQL 严格模式下 CharField 即使模型定义了 default='',CREATE 不传字段仍报错。
显式传入 geo_country/geo_province/geo_city/geo_source='' 解决。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 16:16:46 +08:00
seaislee1209
be656900c0 feat: v0.9.7 登录风控第二期 — IP归属地解析 + 异常检测(R1-R5) + 飞书告警 + 自动封禁
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m13s
- IP138 在线 API + ip2region 离线库双通道归属地解析,60 秒熔断降级
- 5 条异常检测规则:地区不对/不可能旅行/频繁登录/团队遍地开花/海外IP太杂
- 飞书 interactive 卡片告警(红色严重/橙色警告),含辅助指标
- R2 自动封禁用户、R4 自动封禁团队,封禁即踢下线
- 系统设置页全局配置 + 团队详情页独立阈值覆盖
- 安全日志页面 + 管理员修改密码入口

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 00:02:56 +08:00
seaislee1209
e2973284d0 feat: 账号安全管控 + 内容资产页 + UI修缮 (v0.9.5 & v0.9.6)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m20s
v0.9.5 — 账号安全管控 + 内容资产页:
- 首次登录强制改密(must_change_password + ForceChangePasswordModal)
- 并发会话限制(ActiveSession + SessionJWT认证,可配置桌面/移动端会话数)
- Token生命周期缩短(access 30min, refresh 1天)
- 登录IP记录(LoginRecord模型,为异常检测打基础)
- 内容资产页(超管三级折叠/团队管两级折叠,按需懒加载)

v0.9.6 — UI修缮:
- 侧栏导航排序(内容资产移到用户管理下方)
- 视频网格高度调整(440px,3行+暗示可滚动)
- 秒数单位统一(不再换算为分钟/小时)
- 提示词标签溢出修复 + 弹窗方向自适应

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 12:02:54 +08:00
seaislee1209
85f76d8543 feat: v0.8.2~v0.8.4 — 管理后台 UI 修复 + 团队详情重构 + 审计日志系统
v0.8.2: DatePicker/Select 暗色主题、公告跑马灯、Toast 全局化、失败原因 tooltip
v0.8.3: 团队详情抽屉→弹窗重构 + 修改秒数池功能 + member_count 修复
v0.8.4: AdminAuditLog 模型 + 12 处管理操作埋点 + 日志查询页面(/admin/logs)

审计日志覆盖所有管理员 mutation 操作(充值、修改额度、创建/禁用用户等),
记录操作人、变更前后值、IP 地址,支持按操作类型/操作人/日期筛选。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 01:18:44 +08:00
seaislee1209
f803a1ba71 feat: v0.8.1 — Seedance API 友好错误提示 + 前端 Mock 数据清理
- 新增 SeedanceAPIError 异常类 + ERROR_MESSAGES 错误码中文映射
- views.py 异常处理区分 SeedanceAPIError,存储友好错误信息
- 移除 DEV 环境 7 个 mock 任务,消除 404 轮询错误

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 22:31:14 +08:00
seaislee1209
32f0ee58f4 feat: v0.8.0 — Seedance API 全流程修复 + TOS 视频持久化
- 新增音频引用传递给 Seedance API
- 视频生成完成后自动持久化到 TOS(永久 CDN URL)
- 移除 ARK_API_KEY 硬编码默认值
- 前端渐进式轮询(10s/30s/60s)替代固定 3 分钟
- TOS 桶切换到 airdrama-media (cn-beijing)
- K8s Secret 注入 TOS 密钥,CI/CD 同步更新

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 21:26:27 +08:00
zyc
c1f29cbf85 feat: integrate Seedance API key via K8s Secret and auto-create admin user
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m46s
- CI/CD creates K8s Secret from Gitea Secrets (ARK_API_KEY not in code)
- Backend deployment reads ARK_API_KEY from secretKeyRef
- Enable SEEDANCE_ENABLED=true in production
- Auto-create admin superuser on container startup if not exists
- Update CLAUDE.md and agent-auto memory docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 00:41:22 +08:00
zyc
566c3a476f add 存储桶
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m17s
2026-03-13 15:38:08 +08:00