protected function _initialize()
{
parent::initialize();
define('USER_ID',Session::get('user_id'));
}
protected function isLogin()
{
if (empty(USER_ID)){
$this -> error ('用户未登录,无权访问',url('user/login'));
}
}
protected function alreadyLogin()
{
if (!empty(USER_ID)){
$this -> error('用户已经登陆,请勿重复登陆',url('index/index'));
}
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你的魔术函数不要给 protected 属性,给public