Base.php 735 B

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