public function distance(Request $request){$all=$request->all();//当前纬度$hereLatitude=$all['hereLatitude'];//经度$hereLongitude=$all['hereLongitude'];//目的地纬度$toLatitude=$all['toLatitude'];//目的地经度$toLongitude=$all['toLongitude'];$url="https://apis.map.qq.com/ws/distance/v1/matrix";//请求接口$key="";//申请的key$from=$hereLatitude.','.$hereLongitude;$to=$toLatitude.','.$toLongitude;$mode="driving";$url=$url.'?key='.$key.'&from='.$from.'&to='.$to.'&mode='.$mode;$result= json_decode(file_get_contents($url),true);return ['code'=>200,'mes'=>'接收成功','data'=>$result];}