Silent 6 years ago
parent
commit
4e0a90ae27
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/Http/Controllers/TestController.php

+ 2 - 1
app/Http/Controllers/TestController.php

xqd
@@ -16,7 +16,8 @@ class TestController extends Controller
         $client = new Client();
         $from = '39.916527,116.397128';
         $to = $from;
-        $res = $client->get('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 = (string)$res->getBody();
         dd($res);
         return response()->json(['status' => 'success', 'data' => $res]);