facelogin 返回name
This commit is contained in:
parent
1be0ec0fd8
commit
2f5d672736
|
@ -36,7 +36,7 @@ class HRMService:
|
||||||
# 识别成功
|
# 识别成功
|
||||||
user = User.objects.get(id=face_users[index])
|
user = User.objects.get(id=face_users[index])
|
||||||
return user, ''
|
return user, ''
|
||||||
return None, '人脸未匹配'
|
return None, '人脸未匹配,请调整位置'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_facedata_from_img(cls, img_path):
|
def get_facedata_from_img(cls, img_path):
|
||||||
|
|
|
@ -183,6 +183,7 @@ class FaceLogin(CreateAPIView):
|
||||||
return Response({
|
return Response({
|
||||||
'refresh': str(refresh),
|
'refresh': str(refresh),
|
||||||
'access': str(refresh.access_token),
|
'access': str(refresh.access_token),
|
||||||
'username':user.username
|
'username':user.username,
|
||||||
|
'name':user.name
|
||||||
})
|
})
|
||||||
return Response(msg, status=status.HTTP_400_BAD_REQUEST)
|
return Response(msg, status=status.HTTP_400_BAD_REQUEST)
|
Loading…
Reference in New Issue