From 2f5d67273601546ecf269aa85289600b977ea8a0 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 24 Feb 2022 23:13:53 +0800 Subject: [PATCH] =?UTF-8?q?facelogin=20=E8=BF=94=E5=9B=9Ename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hb_server/apps/hrm/services.py | 2 +- hb_server/apps/hrm/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hb_server/apps/hrm/services.py b/hb_server/apps/hrm/services.py index 60c8023..eca4639 100644 --- a/hb_server/apps/hrm/services.py +++ b/hb_server/apps/hrm/services.py @@ -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): diff --git a/hb_server/apps/hrm/views.py b/hb_server/apps/hrm/views.py index 575f324..c9121b0 100644 --- a/hb_server/apps/hrm/views.py +++ b/hb_server/apps/hrm/views.py @@ -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) \ No newline at end of file