From 3b25b9cfb475aac9ad173a59aab39df187c20ae0 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 12 Jun 2026 16:02:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20llminference.dspy=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BD=99=E9=A2=9D/=E5=AE=9A=E4=BB=B7=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=8B=A6=E6=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit checkCustomerBalance 返回值 f 之前被丢弃,导致即使余额不足或 模型未配置定价,直接调 API 仍可执行推理。 添加 if not f 判断,返回 UiError 拦截。 --- wwwroot/llminference.dspy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wwwroot/llminference.dspy b/wwwroot/llminference.dspy index fcc6a46..bee9b9b 100644 --- a/wwwroot/llminference.dspy +++ b/wwwroot/llminference.dspy @@ -11,6 +11,8 @@ userorgid = await get_userorgid() if userid is None: return UiError(title='llm inference', message='Please login first') f = await checkCustomerBalance(params_kw.llmid, userid, userorgid) +if not f: + return UiError(title='llm inference', message='余额不足或模型未配置定价') kdbids = params_kw.kdbids if kdbids: data = {