From cb5f2f8bce21357384c7eb212e6dedfe1a0d4fe6 Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Thu, 19 Mar 2020 07:37:26 +0800 Subject: [PATCH] :bug: Fixing a bug. --- application/http/middleware/Initialize.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/http/middleware/Initialize.php b/application/http/middleware/Initialize.php index 85c832fb..a3e89730 100644 --- a/application/http/middleware/Initialize.php +++ b/application/http/middleware/Initialize.php @@ -18,14 +18,14 @@ class Initialize if ($request->controller(true) !== 'install' || $request->action(true) !== 'index') { return redirect(url('install/index')); } - } - - // 检测封禁IP - $banIp = $this->getConfig('ban_ip'); - if ($banIp) { - $ips = explode(',', str_replace(',', ',', $banIp)); - if ($this->banIp($request->ip(), $ips)) { - throw new HttpResponseException(Response::code(403)); + } else { + // 检测封禁IP + $banIp = $this->getConfig('ban_ip'); + if ($banIp) { + $ips = explode(',', str_replace(',', ',', $banIp)); + if ($this->banIp($request->ip(), $ips)) { + throw new HttpResponseException(Response::code(403)); + } } }