From c949a51f2e776e2da64874721892ec018b9f8dcb Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 31 May 2026 12:26:55 +0800 Subject: [PATCH] fix: gen_sms_code.dspy handle both None return and exception from generate_sms_code --- wwwroot/gen_sms_code.dspy | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wwwroot/gen_sms_code.dspy b/wwwroot/gen_sms_code.dspy index 7177cce..6acbabf 100644 --- a/wwwroot/gen_sms_code.dspy +++ b/wwwroot/gen_sms_code.dspy @@ -18,6 +18,13 @@ except Exception as e: "message": f"发送验证码出错: {e}" } } +if xx is None: + return { + "status": "error", + "data": { + "message": "发送验证码出错,请检查短信模板配置和百度API连接" + } + } id, code = xx debug(f'{id=},{code=}') return {