From 480a3e377f6023785955436a4257dc9a10c5f50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 23 Feb 2017 15:00:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0isLogin=E4=B8=BApro=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Login.php | 2 +- extend/controller/BasicAdmin.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/controller/Login.php b/application/admin/controller/Login.php index 9b411eaa7..386061232 100644 --- a/application/admin/controller/Login.php +++ b/application/admin/controller/Login.php @@ -18,7 +18,7 @@ class Login extends BasicAdmin { * 控制器基础方法 */ public function _initialize() { - if ($this->isLogin() && $this->request->action() !== 'out') { + if ($this->_isLogin() && $this->request->action() !== 'out') { $this->redirect('@admin'); } } diff --git a/extend/controller/BasicAdmin.php b/extend/controller/BasicAdmin.php index 294017c24..c26f93fe1 100644 --- a/extend/controller/BasicAdmin.php +++ b/extend/controller/BasicAdmin.php @@ -46,7 +46,7 @@ class BasicAdmin extends Controller { public function _initialize() { # 用户登录状态检查 if ($this->checkLogin || $this->checkAuth) { - if (!$this->isLogin()) { + if (!$this->_isLogin()) { $this->redirect('@admin/login'); } } @@ -68,7 +68,7 @@ class BasicAdmin extends Controller { * 判断用户是否登录 * @return bool */ - public function isLogin() { + protected function _isLogin() { $user = session('user'); if (empty($user) || empty($user['id'])) { return false;