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;