Base.php 736 B

12345678910111213141516171819202122232425262728293031
  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. use think\Request;
  10. class Base extends Common
  11. {
  12. public function _initialize()
  13. {
  14. $aid = is_login(config('myconfig.admin_cookie_key'),db('AdminUser'),model('common/AdminUser'));
  15. if( !$aid ){// 还没登录 跳转到登录页面
  16. $this->redirect(url('User/login'));
  17. }
  18. //权限验证
  19. $this->aid = $aid;
  20. $this->assign('user_id',$aid);
  21. $request=Request::instance();
  22. // if (!authCheck($request->module(),$request->controller(),$request->action(),$this->aid)) {
  23. // $this->error('你没有权限!');
  24. // }
  25. }
  26. }