// +---------------------------------------------------------------------- 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'] ?? []; } }