更新isLogin为pro方法

This commit is contained in:
邹景立 2017-02-23 15:00:27 +08:00
parent 93292e6f8d
commit 480a3e377f
2 changed files with 3 additions and 3 deletions

View File

@ -18,7 +18,7 @@ class Login extends BasicAdmin {
* 控制器基础方法 * 控制器基础方法
*/ */
public function _initialize() { public function _initialize() {
if ($this->isLogin() && $this->request->action() !== 'out') { if ($this->_isLogin() && $this->request->action() !== 'out') {
$this->redirect('@admin'); $this->redirect('@admin');
} }
} }

View File

@ -46,7 +46,7 @@ class BasicAdmin extends Controller {
public function _initialize() { public function _initialize() {
# 用户登录状态检查 # 用户登录状态检查
if ($this->checkLogin || $this->checkAuth) { if ($this->checkLogin || $this->checkAuth) {
if (!$this->isLogin()) { if (!$this->_isLogin()) {
$this->redirect('@admin/login'); $this->redirect('@admin/login');
} }
} }
@ -68,7 +68,7 @@ class BasicAdmin extends Controller {
* 判断用户是否登录 * 判断用户是否登录
* @return bool * @return bool
*/ */
public function isLogin() { protected function _isLogin() {
$user = session('user'); $user = session('user');
if (empty($user) || empty($user['id'])) { if (empty($user) || empty($user['id'])) {
return false; return false;