From 4afda8992c382e9debb7e3aa4a594a322129c277 Mon Sep 17 00:00:00 2001 From: wwwwwwwww <526125649@qq.com> Date: Tue, 21 Jul 2026 19:28:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=A7=AF=E5=88=86=E4=B8=8D?= =?UTF-8?q?=E8=B6=B3=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- video-gen-api/app/api/v1/generation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/video-gen-api/app/api/v1/generation.py b/video-gen-api/app/api/v1/generation.py index 9f82010e..d2bf5fa4 100644 --- a/video-gen-api/app/api/v1/generation.py +++ b/video-gen-api/app/api/v1/generation.py @@ -271,6 +271,9 @@ async def optimize( db: AsyncSession = Depends(get_db), ): record = None + # 积分不足直接返回 + if (current_user.credits or 0) < 5: + raise HTTPException(status_code=402, detail="积分不足,请充值") # Validate parameters based on generation type if req.gen_type == GenerationType.video: if req.duration not in DURATIONS: