|
@@ -313,9 +313,9 @@ class TdwyController extends BaseController
|
|
|
|
|
|
//获取public_key
|
|
|
$url = '/evo-apigw/evo-oauth/1.0.0/oauth/public-key';
|
|
|
- $result = $this->httpRequest($ip.$url);
|
|
|
- if($result['data']['publicKey']){
|
|
|
- $public_key = $result['data']['publicKey'];
|
|
|
+ $result1 = $this->httpRequest($ip.$url);
|
|
|
+ if($result1['data']['publicKey']){
|
|
|
+ $public_key = $result1['data']['publicKey'];
|
|
|
}else{
|
|
|
return;
|
|
|
}
|
|
@@ -364,52 +364,6 @@ class TdwyController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //大华摄像头
|
|
|
- public function geturl(Request $request){
|
|
|
- $ip = 'https://222.75.25.198:8443';
|
|
|
- $url = '/evo-apigw/evo-oauth/1.0.0/oauth/public-key';
|
|
|
- $result = $this->httpRequest($ip.$url);
|
|
|
- $public_key = $result['data']['publicKey'];
|
|
|
-
|
|
|
- $url2 = '/evo-apigw/evo-oauth/1.0.0/oauth/extend/token';
|
|
|
- $password = $this->rsaEncode("xxzx!#%246",$public_key);
|
|
|
- $params = [
|
|
|
- 'grant_type'=>'password',
|
|
|
- 'username'=>'system',
|
|
|
- 'password'=>$password,
|
|
|
- 'client_id'=>'dahua',
|
|
|
- 'client_secret'=>'45815ebb-300c-416f-8adf-da07a07fab8a',
|
|
|
- 'public_key'=>$public_key
|
|
|
- ];
|
|
|
- $result2 = $this->httpRequest($ip.$url2,'post',$params);
|
|
|
- $access_token = $result2['data']['access_token'];
|
|
|
-
|
|
|
- $url3 = '/evo-apigw/evo-brm/1.2.0/device/channel/subsystem/page';
|
|
|
- $params2 = [
|
|
|
- 'pageNum'=>1,
|
|
|
- 'pageSize'=>1000,
|
|
|
- 'sortType'=>'ASC',
|
|
|
- 'sort'=>'channelSn',
|
|
|
-// 'isOnline'=>0,
|
|
|
-// 'stat'=>1
|
|
|
- ];
|
|
|
-// dd($params2);
|
|
|
- $result3 = $this->httpRequest($ip.$url3,'post',$params2,$access_token);
|
|
|
-// dd($result3);
|
|
|
-// 1000006$1$0$0 1000012$1$0$0
|
|
|
-
|
|
|
- $url4 = '/evo-apigw/admin/API/MTS/Video/StartVideo';
|
|
|
- $params3['data'] = [
|
|
|
- 'channelId'=>'1000006$1$0$0',
|
|
|
- 'dataType'=>'1',
|
|
|
- 'streamType'=>'1'
|
|
|
- ];
|
|
|
-// dd($params3);
|
|
|
- $result4 = $this->httpRequest($ip.$url4,'post',$params3,$access_token);
|
|
|
- $result4['access_token'] = $access_token;
|
|
|
- dd($result4);
|
|
|
- }
|
|
|
-
|
|
|
//接口第三方调用
|
|
|
public function httpRequest($url, $format = 'get', $data = null, $token = null){
|
|
|
//设置头信息
|