$this->authName, 'password' => $this->authPwd ]; try { $result = curl_post($url,[],$data); if(!empty($result) && !empty($result['data']['token'])){ Cache::set('gps_token', $result['data']['token'], $this->expTime); return $result['data']['token']; }else{ return ''; } }catch (\Exception $e) { return ''; } } public function getCarInfo() { //获取token $token = $this->getToken(); //请求地址 $url = 'https://www.gpsnow.net/car/getByImei.do'; //请求参数 $data = [ 'token' => $token, 'imei' => '863010000029350' ]; $result = curl_post($url,[],$data); dump($result); } public function getCarStatus() { //获取token $token = $this->getToken(); //请求地址 $url = 'https://www.gpsnow.net/car/getCarAndStatus.do'; //请求参数 $data = [ 'token' => $token, 'carId' => '629942', 'mapType' => 1 ]; $result = curl_post($url,[],$data); dump($result); } public function getHistory() { dump(PHP_VERSION);die; //获取token $token = $this->getToken(); //请求地址 $url = 'https://www.gpsnow.net/position/queryHistory.do'; //请求参数 $data = [ 'token' => $token, 'carId' => '629942', 'startTime' => '2023-08-15 00:00:00', 'endTime' => '2023-08-15 23:59:59', 'filter' => true, 'interval' => 1, 'pointType' => 2, ]; $result = curl_post($url,[],$data); dump($result); } }