MemberLogMiddleware.php 519 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Http\Middleware;
  3. use App\Servers\AdminLogsServer;
  4. use App\Servers\MemberLogsServer;
  5. use Closure;
  6. class MemberLogMiddleware
  7. {
  8. /**
  9. * Handle an incoming request.
  10. *
  11. * @param \Illuminate\Http\Request $request
  12. * @param \Closure $next
  13. * @return mixed
  14. */
  15. public function handle($request, Closure $next)
  16. {
  17. //记录访问日志
  18. // dd($_SERVER['HTTP_X_FORWARDED_FOR']);
  19. MemberLogsServer::write();
  20. return $next($request);
  21. }
  22. }