12345678910111213141516171819202122232425262728293031 |
- <?php
- /**
- * Created by PhpStorm.
- * User: chengxun
- * Date: 2018/5/14
- * Time: 17:48
- */
- namespace app\index\controller;
- use think\Request;
- class Base extends Common
- {
- public function _initialize()
- {
- $aid = is_login(config('myconfig.admin_cookie_key'),db('AdminUser'),model('common/AdminUser'));
- if( !$aid ){// 还没登录 跳转到登录页面
- $this->redirect(url('User/login'));
- }
- //权限验证
- $this->aid = $aid;
- $this->assign('user_id',$aid);
- $request=Request::instance();
- // if (!authCheck($request->module(),$request->controller(),$request->action(),$this->aid)) {
- // $this->error('你没有权限!');
- // }
- }
- }
|