diff --git a/app/Http/Middleware/isForbidden.php b/app/Http/Middleware/isForbidden.php index a2ac11f6..ce4ee6d6 100644 --- a/app/Http/Middleware/isForbidden.php +++ b/app/Http/Middleware/isForbidden.php @@ -48,7 +48,7 @@ class isForbidden $ipLocation = IP::getIPInfo($ip); // 拒绝无IP请求 - if (empty($ipLocation) || empty($ipLocation['city'])) { + if ( ! $ipLocation || empty(array_filter($ipLocation))) { return Response::view( 'auth.error', ['message' => trans('error.ForbiddenAccess')],