Base.php 675 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: chengxun
  5. * Date: 2018/5/14
  6. * Time: 17:48
  7. */
  8. namespace app\index\controller;
  9. class Base extends Common
  10. {
  11. public function _initialize()
  12. {
  13. $aid = is_login(config('myconfig.admin_cookie_key'),db('AdminUser'),model('common/AdminUser'));
  14. if( !$aid ){// 还没登录 跳转到登录页面
  15. $this->redirect(url('User/login'));
  16. }
  17. //权限验证
  18. $this->aid=$aid;
  19. $request=Request::instance();
  20. // if (!authCheck($request->module(),$request->controller(),$request->action(),$this->aid)) {
  21. // $this->error('你没有权限!');
  22. // }
  23. }
  24. }