params['ptStyle'] = 6; $staffId = jwt::getLoginId(); if (empty($staffId)) { $this->validate = false; } //游客可以访问的方法 if (in_array($action->id, $this->guestAccess)) { $this->validate = true; } else { $staff = StaffService::getById($staffId); if (empty($staff)) { util::fail('没有找到管理员'); } $this->staff = $staff; $this->user = $staff; } if ($this->validate == false) { util::notLogin(); } $this->staffId = $staffId; return parent::beforeAction($action); } }