添加ip查询接口

This commit is contained in:
“wanyongkang”
2025-05-16 18:29:01 +08:00
parent 2eae6b28f3
commit e81e23e0f1

View File

@@ -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']);
}
}