Files
WoMenQuNaJu/MeetSpot/app/auth/sms.py
2026-02-04 16:11:55 +08:00

25 lines
555 B
Python
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.
"""短信验证码(Mock版)。"""
from typing import Dict
MOCK_CODE = "123456"
_code_store: Dict[str, str] = {}
async def send_login_code(phone: str) -> str:
"""Mock发送验证码固定返回`123456`。
- 真实环境可替换为短信网关调用
- 这里简单记忆最后一次下发的验证码,便于后续校验扩展
"""
_code_store[phone] = MOCK_CODE
return MOCK_CODE
def validate_code(phone: str, code: str) -> bool:
"""校验验证码MVP阶段固定匹配Mock值。"""
return code == MOCK_CODE