validate = false; } //游客可以访问的方法 if (in_array($action->id, $this->withoutLogin)) { $this->validate = true; } if ($this->validate == false) { util::notLogin(); } if (!empty($userId)) { $staff = UserService::getUserInfo($userId); $this->staff = $staff; $this->user = $staff; } $this->staffId = $staffId; $this->userId = $userId; $open = WxOpenService::getById($this->wxOpenId); $this->wxOpen = $open; $merchantId = isset($open['merchantId']) ? $open['merchantId'] : 0; $this->merchantId = $merchantId; if (!empty($merchantId)) { $this->merchant = MerchantService::getById($merchantId); } return parent::beforeAction($action); } }