<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller {
public function _initialize(){
if(empty($_SESSION['login'])){
$this->redirect('Login/login');
eixt();
}
}
}
不管操作哪个控制器,都会先执行这一段
<?php
namespace Admin\Controller;
use Think\Controller;
class CommonController extends Controller {
public function _initialize(){
if(empty($_SESSION['login'])){
$this->redirect('Login/login');
eixt();
}
}
}
不管操作哪个控制器,都会先执行这一段
转载于:https://my.oschina.net/qjd/blog/786353