项目积分不足直接返回

This commit is contained in:
2026-07-21 19:28:02 +08:00
parent 6f37134c8c
commit 4afda8992c
+3
View File
@@ -271,6 +271,9 @@ async def optimize(
db: AsyncSession = Depends(get_db), db: AsyncSession = Depends(get_db),
): ):
record = None record = None
# 积分不足直接返回
if (current_user.credits or 0) < 5:
raise HTTPException(status_code=402, detail="积分不足,请充值")
# Validate parameters based on generation type # Validate parameters based on generation type
if req.gen_type == GenerationType.video: if req.gen_type == GenerationType.video:
if req.duration not in DURATIONS: if req.duration not in DURATIONS: