rbac/wwwroot/gen_sms_code.dspy
2026-03-21 15:31:36 +08:00

27 lines
489 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

phone = params_kw.cellphone
if phone is None:
return {
"status": "error",
"data":{
"message": "没有收到手机号"
}
}
# 使用短信模块发布的sms_engine实例生成验证码参数手机号
xx = await sms_engine.generate_sms_code(phone)
if xx is None:
return {
"status": "error",
"data": {
"message": "发送验证码出错"
}
}
id, code = xx
debug(f'{id=},{code=}')
return {
"status": "ok",
"data": {
"message": "短信码已生成",
"key": id
}
}