1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- // +----------------------------------------------------------------------
- // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
- // +----------------------------------------------------------------------
- // | Author: CRMEB Team <admin@crmeb.com>
- // +----------------------------------------------------------------------
- namespace app\controller\admin;
- use app\Request;
- use crmeb\basic\BaseController;
- /**
- * 基类 所有控制器继承的类
- * Class AuthController
- * @package app\controller\admin
- * @property Request $request
- * @property $services
- * @method success($message = '',array $data = [])
- * @method fail($message = '',array $data = [])
- */
- class AuthController extends BaseController
- {
- /**
- * 当前登陆管理员信息
- * @var
- */
- protected $adminInfo;
- /**
- * 当前登陆管理员ID
- * @var
- */
- protected $adminId;
- /**
- * 当前管理员权限
- * @var array
- */
- protected $auth = [];
- /**
- * 初始化
- */
- protected function initialize()
- {
- $this->adminId = $this->request->hasMacro('adminId') ? $this->request->adminId() : 0;
- $this->adminInfo = $this->request->hasMacro('adminInfo') ? $this->request->adminInfo() : [];
- $this->auth = $this->adminInfo['rule'] ?? [];
- }
- }
|