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'));
}
}
index.html:1 Error in event handler for (unknown): TypeError: Cannot read property ' parentNode' of undefined出現這個報錯訊息,謝謝幫忙
empty換成defined