This commit is contained in:
chenyang
2022-07-01 07:30:07 +08:00
parent c7cc3cc5c4
commit 132432c7d5
3 changed files with 16 additions and 12 deletions
+5 -2
View File
@@ -1,5 +1,7 @@
from django.http.response import JsonResponse
from rest_framework.views import APIView
from django.http import HttpResponse
from server_auth.models import MindUser
class MindUserView(APIView):
@@ -12,4 +14,5 @@ class MindUserView(APIView):
user_name = data_dict.get('userName')
input_password = data_dict.get('inputPassword')
print('userName:%s,inputPassword:%s' % (user_name, input_password))
return HttpResponse("success")
MindUser.objects.create_user(username=user_name, password=input_password, email='')
return JsonResponse({"code": 0, "msg": "success"})