facelogin 返回name

This commit is contained in:
caoqianming 2022-02-24 23:13:53 +08:00
parent 1be0ec0fd8
commit 2f5d672736
2 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class HRMService:
# 识别成功
user = User.objects.get(id=face_users[index])
return user, ''
return None, '人脸未匹配'
return None, '人脸未匹配,请调整位置'
@classmethod
def get_facedata_from_img(cls, img_path):

View File

@ -183,6 +183,7 @@ class FaceLogin(CreateAPIView):
return Response({
'refresh': str(refresh),
'access': str(refresh.access_token),
'username':user.username
'username':user.username,
'name':user.name
})
return Response(msg, status=status.HTTP_400_BAD_REQUEST)