Commit ac467046 by 杨树贤

调试

parent e6935be8
Showing with 2 additions and 0 deletions
...@@ -23,11 +23,13 @@ class CheckIp ...@@ -23,11 +23,13 @@ class CheckIp
return $next($request); return $next($request);
} }
$ip = $request->ip(); $ip = $request->ip();
Log::warning($ip);
$reader = new Reader(storage_path('app/GeoLite2-Country.mmdb')); $reader = new Reader(storage_path('app/GeoLite2-Country.mmdb'));
$record = $reader->get($ip); $record = $reader->get($ip);
if (empty($record)) { if (empty($record)) {
return $next($request); return $next($request);
} }
Log::warning(json_encode($record));
if (in_array($record['country']['iso_code'], config('field.disable_ip_iso_code'))) { if (in_array($record['country']['iso_code'], config('field.disable_ip_iso_code'))) {
view()->share('is_disable_ip', 1); view()->share('is_disable_ip', 1);
return redirect()->to('/info'); return redirect()->to('/info');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment