diff --git a/hb_server/utils/view.py b/hb_server/utils/view.py index c44f11b..30bc9be 100644 --- a/hb_server/utils/view.py +++ b/hb_server/utils/view.py @@ -60,8 +60,8 @@ class GenSignature(APIView): image[i][j][0],image[i][j][1],image[i][j][2] = 0,0,0 ext = os.path.splitext(path) new_path = ext[0] + '.png' - cv2.imwrite(new_path,image) - return Response({'path':new_path}, status=status.HTTP_200_OK) + cv2.imwrite(new_path, image) + return Response({'path':new_path.replace(BASE_DIR, '')}, status=status.HTTP_200_OK) except: return Response('签名照处理失败,请重新上传', status=status.HTTP_400_BAD_REQUEST)