custom fsi

This commit is contained in:
dongpd 2023-01-04 17:00:39 +07:00
parent 5450124be9
commit 4b4f33777c

View File

@ -104,17 +104,33 @@ class ApiController extends Controller {
$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([
$res = json_decode(file_get_contents($ip . "/api/oem/face_recognition?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)),
'data' => common::rsaEncode($text),
'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",
'confidence' => isset($post["confidence"]["percent1"]) ? $post["confidence"]["percent1"] : 0
])
]
])), true);
// $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)),
// 'data' => common::rsaEncode($text),
// 'confidence' => isset($post["confidence"]["percent1"]) ? $post["confidence"]["percent1"] : 0
// ])
// ]
// ])), true);
if ($res['status'] == 10000) {
$logsInfo->sync_status = 1;
$logsInfo->save();