merchantId = $account; $this->merchant = $merchant; $this->merchantExtend = MerchantExtendService::getByMerchantId($account); $this->isWeixin = util::isWeixin(); if (empty($userId)) { $this->validate = false; } else { $this->validate = true; $this->userId = $userId; $this->user = UserService::getById($userId); } //游客可以访问的方法 if (in_array($action->id, $this->withoutLogin)) { $this->validate = true; } if ($this->validate == false) { util::notLogin(); } return parent::beforeAction($action); } }