From 2ac6546c3e31b001aabb69d8edaeb1a216a51b80 Mon Sep 17 00:00:00 2001 From: jhx <133451314@qq.com> Date: Wed, 6 Jul 2022 15:53:50 +0800 Subject: [PATCH] update --- app/controller/Index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controller/Index.php b/app/controller/Index.php index 6ca6fc7..a9e7cba 100644 --- a/app/controller/Index.php +++ b/app/controller/Index.php @@ -43,10 +43,14 @@ class Index if ($record) { $record = $record->toArray(); + $mapUrl = "https://www.google.com/maps/search/{$record['latitude']},{$record['longitude']}"; } else { $record = []; + $mapUrl = ''; } - return json(['ip' => $ip, 'record' => $record]); + return json(['ip' => $ip, 'record' => $record, 'map' => [ + 'google' => $mapUrl + ]]); } }