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