diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 2c1a8a0..d673487 100644 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -36,4 +36,17 @@ class Index extends Controller ]; echo json_encode($data); } + + public function getIpAddress() + { + if(!$_GET){ + die; + } + $ip = $_GET['ip']; + + $cip_content = json_decode(file_get_contents('https://sp0.baidu.com/8aQDcjqpAAV3otqbppnN2DJv/api.php?co=&resource_id=6006&oe=utf8&query='.$ip),true); + + \result($cip_content['data'][0]['location']); + + } } \ No newline at end of file