|
@@ -66,7 +66,7 @@ class ApiController extends Controller
|
|
$to = $request->input('latitude') . ',' . $request->input('longitude');
|
|
$to = $request->input('latitude') . ',' . $request->input('longitude');
|
|
$url = 'https://apis.map.qq.com/ws/distance/v1/?from=' . $from . '&to=' . $to . '&key=' . env('TECENT_POSITION_KEY');
|
|
$url = 'https://apis.map.qq.com/ws/distance/v1/?from=' . $from . '&to=' . $to . '&key=' . env('TECENT_POSITION_KEY');
|
|
$res = $client->get($url);
|
|
$res = $client->get($url);
|
|
- $res = $res->getBody();
|
|
|
|
|
|
+ $res = json_decode((string)$res->getBody());
|
|
return response()->json(['status' => 'success', 'data' => $res]);
|
|
return response()->json(['status' => 'success', 'data' => $res]);
|
|
}
|
|
}
|
|
}
|
|
}
|