废话不多说直接上代码
如果有幸能帮到你,请帮我点个【赞】,给个关注,如果能顺带评论给个鼓励,将不胜感激。
<?php
namespace lib;
header('Content-type:text/html; Charset=utf-8');
date_default_timezone_set('PRC');
class Person
{
public $pre_url = "海康的请求接口地址";
protected $app_key = "合作方appKey";
protected $app_secret = "合作方appSecret";
public $time ;//时间戳
public $content_type="application/json";//json类型
public $accept="*/*" ;
public $method = array(
"POST" => "POST"
);
public $list_url= array(
'application/oneToMany'=>"/artemis/api/frs/v1/application/oneToMany",
'face/group'=>"/artemis/api/frs/v1/face/group",
);
public $date=null;
private static $redis=null;
const CACHE_ACCESS_TOKEN = "access_token";
public function __construct($app_key='', $app_secret='')
{
if($app_key!='') $this->app_key = $app_key;
if($app_secret!='') $this->app_secret = $app_secret;
$this->charset = 'utf-8';
list($msec, $sec) = explode(' ', microtime());
$this->time = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
}
//按人脸查询分组/api/frs/v1/face/group 获得分组的idfaceGroupIndexCodes
public function get_rlcx(){
//请求参数
$postData=[
"name"=>"测试分组"
];
$sign = $this->g