Index.php 1.1 KB
<?php
/**
 * Created by PhpStorm.
 * User: YRF
 * Date: 2023/11/14
 * Time: 16:42
 */

namespace app\api\controller\v8;
//允许所有的跨域请求
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Headers: *");
header('Access-Control-Allow-Methods: POST,GET,OPTIONS');
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Max-Age: 86400');
date_default_timezone_set('PRC');


use app\common\controller\Api;
use app\common\helper\HttpHelper;
use think\Db;

//v6 巡检端功能
class Index extends Api
{
    // 无需登录的接口,*表示全部
    protected $noNeedLogin = ['*'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    //1.查询摄像头接口
    public function getCamera(){
        $url="https://camera.ynzhsk.cn/api/reservoir/hkws/Hardware/getListByReservoir";
        $info =HttpHelper::get($url);

        $info = json_decode($info, true);
        if($info['data']){
            return $this->success("返回成功",$info);
        }else{
            return $this->error("返回失败");
        }


    }
}