rbac/wwwroot/gen_sms_code.dspy
yumoqing 567513789e feat: rewrite SMS login UI with fetch-based flow matching phone_login.dspy API
- login.ui: SMS tab now uses fetch for gen_sms_code.dspy and phone_login.dspy
- Added _webbricks_=1 to fetch URLs (prevents HTML wrapping)
- Added 60s countdown timer on send-code button
- Added multi-account selection UI (status=choose response)
- Fixed uitype 'hide' -> 'hidden' for codeid field
- Dispatches user_logined event after successful phone login
- gen_sms_code.dspy: improved error message for SMS service config issues
- phone_login.dspy: added mark_used parameter for multi-account flow
- phone_login.js: sageSelectAccount handler for account selection
2026-05-29 11:31:39 +08:00

27 lines
519 B
Plaintext
Raw 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
}
}