1, 'pageSize' => 10, ]; $json_data = json_encode($dataArr); $result = postToken($url,$json_data,false,[],$token); $res_data = json_decode($result,true); if ($res_data['code'] != 0) throw new \Exception('请求失败'); $list = (array)$res_data['data']['list']; $urlArr = []; foreach ($list as $row) { # 获取监控点视频链接 $cameraIndexCode = $row['cameraIndexCode']; $url2 = $config['host_url'] . "/api/video/v2/cameras/previewURLs"; $dataArr2 = [ 'cameraIndexCode' => $cameraIndexCode, 'streamType' => 0, 'transmode' => $row['transType'], 'expand' => 'transcode=0', 'streamform' => 'ps' ]; $json_data2 = json_encode($dataArr2); $result2 = postToken($url2,$json_data2,false,[],$token); $res_data2 = json_decode($result2,true); if ($res_data2['code'] != 0) throw new \Exception('请求失败'); $list2 = (array)$res_data2['data']; foreach ($list2 as $row2) { $urlArr[] = $row2; } } } catch (\Exception $e) { return $this->renderError($e->getMessage()); } dump($urlArr); dump($list);die; return $this->renderSuccess(compact('urlArr')); } }