add message

This commit is contained in:
baoliang 2020-12-07 10:01:10 +08:00
parent 475b634a4b
commit d670c9fd69
1 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,8 @@ def register_step_one(request):
phone=phone, code=code, category=category).first()
if verify_code and verify_code.is_in_progress():
profile = Userprofile.objects.filter(user__username=phone).first()
if profile.status == 1:
return JsonResponse({'status': 'error', 'message': '账号已激活,不需要重复激活'})
return JsonResponse({'status': 'success', 'message': {'id': profile.user_id, 'phone': phone, 'name': profile.name, 'organization': profile.organization.name}})
else:
return JsonResponse({'status': 'error', 'message': '验证码超时,请重发'})