Protected Function_Initialize ()
{
Parent :: Initialize ();
Define ('Aa', Session :: GET ('Admin_id'));
}
/ /Determine whether the user is logged in at the entrance in the background
protected function isLogin()
{
if (empty(AA)){
$this->error('The user is not logged in and has no rights Access',url('Index/login'));
} }
}
//Prevent users from logging in repeatedly
protected function alreadyLogin(){
)){
$this->error('The user has already logged in, please do not log in again',url('Index/index'));
我只是一条咸鱼哈2017-12-25 18:40:00
It’s a pitfall of TP5. I also reported an error after watching the video like this. I don’t think empty can be used to judge the defined constant (that is, the constant AA you defined). I used a variable to catch it before judging. Define constants and then use them for judgment. It actually works (ー_ー)!! What?
谁把我昵称占了2017-12-25 16:42:47
parent::initialize(); written as parent::_initialize(); take a look