添加ip查询接口
This commit is contained in:
@@ -36,4 +36,17 @@ class Index extends Controller
|
|||||||
];
|
];
|
||||||
echo json_encode($data);
|
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']);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user