ip(); $ip = $request->header('x-forwarded-for'); Log::info("IP".$ip); //判断是否在列表中 if(!in_array($ip,$this->ipList)){ throw new ValidateException('IP非法23'); } } public function after(Response $response) { // TODO: Implement after() method. } }