Merge branch 'dev_DTD' into BiFacePro2.0.1

# Conflicts:
#	controllers/ApiController.php
This commit is contained in:
2021-11-29 10:54:55 +07:00
12 changed files with 110 additions and 31 deletions

View File

@@ -95,18 +95,21 @@ class ApiController extends Controller {
$token = \app\models\SyncUrl::findOne(['key_config' => 'token']);
if ($token)
$tk = $token->data;
$res = json_decode(file_get_contents($ip . "/api/oem/face_recognition?token=" . $tk, false, stream_context_create([
$data = [];
$data[] = strval($id_camera); //camera_id
$data[] = date("Y-m-d H:i:s", $time); //frametime
$data[] = $staffInfo ? strval($staffInfo->code) : "0"; //idCard
$data[] = $staffInfo ? $staffInfo->staff_id : ""; //idObject
$data[] = "123"; //person_id
$data[] = "+7"; //timezone
$text = implode("|", $data);
$res = json_decode(file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
'http' => [
'header' => "Content-Type: application/json",
'method' => "POST",
'content' => json_encode([
'image' => base64_encode(file_get_contents("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $fileName)),
'camera_id' => strval($id_camera),
'frametime' => date("Y-m-d H:i:s", $time),
'idCard' => $staffInfo ? strval($staffInfo->code) : "0",
'idObject' => $staffInfo ? $staffInfo->staff_id : "",
"person_id" => "123",
"timezone" => "+7"
'data' => common::rsaEncode($text)
])
]
])), true);