From ccb9430a258fa02ed718de04a5ea5b338d3bcdd4 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 29 May 2026 23:48:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=98=E5=8E=9Frl=5Fcallback.dspy,=20?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E5=9B=9E=E8=B0=83=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E7=94=B1=E4=BE=9B=E5=BA=94=E5=95=86=E5=86=B3?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/rl_callback.dspy | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/wwwroot/api/rl_callback.dspy b/wwwroot/api/rl_callback.dspy index 3cd7134..ca66202 100644 --- a/wwwroot/api/rl_callback.dspy +++ b/wwwroot/api/rl_callback.dspy @@ -1,8 +1,7 @@ -import json - # Vendor callback POSTs JSON body with BytedToken. # The callback URL is configured when calling CreateVisualValidateSession. # Typical payload: {"BytedToken": "...", "ReqUUID": "...", "Status": "..."} +# Return format depends on vendor requirements. body_str = http_request.get("body", "") or "" byted_token = "" @@ -21,12 +20,8 @@ if not byted_token: byted_token = params_kw.get("BytedToken", params_kw.get("byted_token", "")) if not byted_token: - return json.dumps({"status": "error", "data": {"message": "缺少 BytedToken 参数"}}, ensure_ascii=False) + return {"success": False, "message": "缺少 BytedToken 参数"} # vendor is determined by looking up the session record result = await rl_handle_callback(byted_token, project_name="default") - -if result.get('success'): - return json.dumps({"status": "ok", "data": {"vendor_group_id": result.get('vendor_group_id', '')}}, ensure_ascii=False) -else: - return json.dumps({"status": "error", "data": {"message": result.get('message', '回调处理失败')}}, ensure_ascii=False) +return result