上线版: 产品表单统一+form嵌套修复+用户管理+部署+三套叙事
- 产品编辑入口统一走 ProductFormFull(卖点/风格/人群/品牌词全字段); 修复开任务页 <form> 套 <form> 致"编辑产品"报错、改不了、跳回首个产品 - dashboard 入口卡片对齐实际路由: 系统管理(/config) 与 工作配置(/settings) 分开; settings ?tab=products 直达改用挂载后读 URL, 消除 hydration mismatch - 新增用户管理(users API/admin service/改密页) + alembic 022/023/024 - 上线部署: Dockerfile / docker-compose.prod+https / nginx https / .env.example - A8 三套正交叙事(痛点/场景/成分背书) + beige 调色去AI化 + 飞轮 text_import 高权重信号 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,39 @@ logger = logging.getLogger(__name__)
|
||||
MAX_FANOUT = 5 # 每用户并发上限5(红线);裂变 N 套直出受同等约束
|
||||
|
||||
|
||||
def _source_copy_from_payload(payload) -> str:
|
||||
"""从候选文案 JSON 中提取可裂变的正文,避免把整段 JSON 当 prompt。"""
|
||||
if isinstance(payload, str):
|
||||
raw = payload.strip()
|
||||
if not raw:
|
||||
return ""
|
||||
try:
|
||||
parsed = json.loads(raw)
|
||||
except Exception:
|
||||
return raw
|
||||
return _source_copy_from_payload(parsed)
|
||||
|
||||
if isinstance(payload, dict):
|
||||
parts: list[str] = []
|
||||
for key in ("title", "content", "body", "note", "text", "opening", "selling_points", "tags"):
|
||||
value = payload.get(key)
|
||||
if isinstance(value, str) and value.strip():
|
||||
parts.append(value.strip())
|
||||
elif isinstance(value, list):
|
||||
items = [str(item).strip() for item in value if str(item).strip()]
|
||||
if items:
|
||||
parts.append(" / ".join(items))
|
||||
if parts:
|
||||
return "\n".join(parts)
|
||||
return json.dumps(payload, ensure_ascii=False)
|
||||
|
||||
if isinstance(payload, list):
|
||||
items = [_source_copy_from_payload(item) for item in payload]
|
||||
return "\n".join(item for item in items if item)
|
||||
|
||||
return str(payload or "")
|
||||
|
||||
|
||||
def create_fission(
|
||||
db: Session, current_user: CurrentUser,
|
||||
source_task_id: int, reference_level: str, fanout_count: int,
|
||||
@@ -73,5 +106,5 @@ def _extract_source_copy(db: Session, src: GenerationTask) -> str:
|
||||
.order_by(TextCandidate.is_selected.desc(), TextCandidate.id.asc())
|
||||
.first())
|
||||
if c and c.content:
|
||||
return c.content
|
||||
return _source_copy_from_payload(c.content)
|
||||
return src.theme or ""
|
||||
|
||||
Reference in New Issue
Block a user