feat: update medical training case and auth modules

This commit is contained in:
2026-06-03 17:34:47 +08:00
parent b4bb38b7be
commit fd0b3e1982
45 changed files with 1459 additions and 812 deletions
+2 -1
View File
@@ -44,7 +44,8 @@ def send_code(request):
user_exists = User.objects.filter(phone=phone).exists()
if scene == 'register' and user_exists:
raise AppError('AUTH_PHONE_REGISTERED', '该手机号已注册')
if scene in ('login', 'reset') and not user_exists:
# scene='login':不检查是否已注册(未注册用户通过 login-code 自动注册)
if scene == 'reset' and not user_exists:
raise AppError('AUTH_PHONE_NOT_FOUND', '手机号未注册')
code = generate_sms_code()