BaseController.class.php 332 B

12345678910111213
  1. <?php
  2. namespace Admin\Controller;
  3. use Think\Controller;
  4. class BaseController extends Controller {
  5. public function _initialize(){
  6. if (isset($_SESSION['user_name'])) {
  7. //已登陆,不做任何操作
  8. }else{
  9. // $this->redirect('Login/login');
  10. $this->error('非法操作!',U('Login/login'));
  11. }
  12. }
  13. }