|
@@ -23,6 +23,7 @@ class IpFilter extends Component
|
|
|
public function checkIp()
|
|
public function checkIp()
|
|
|
{
|
|
{
|
|
|
$remoteAddr = $_SERVER['REMOTE_ADDR']; // 获取用户 IP 地址
|
|
$remoteAddr = $_SERVER['REMOTE_ADDR']; // 获取用户 IP 地址
|
|
|
|
|
+ // 调用远程 IP 地址查询方法
|
|
|
if (!self::remoteAddrCall($remoteAddr)) {
|
|
if (!self::remoteAddrCall($remoteAddr)) {
|
|
|
throw new BadRequestHttpException('非法 IP 地址');
|
|
throw new BadRequestHttpException('非法 IP 地址');
|
|
|
}
|
|
}
|