<?php
namespace app\admins\controller;
use think\Controller;
use Util\data\Sysdb;
/**
*
*/
class BaseAdmin extends Controller
{//Account’s session data uses admin as the basis to determine whether the user is logged in. If there is no admin, no user will come in
public function __construct(){
parent::__construct();
//Assign sesson data to admin
$this->_admin = session ('admin');
if (!$this->_admin) {
// //If session has no value, it is judged that the user is not logged in and jumps to the login page
header('Location: /admins.php/admins/Account/login');
exit;
}
}
}
何人不识君2018-09-01 15:26:02
Change the browser and visit http://www.php.demo/admins.php/admins/Home/index