application) { return $this->application; } if (!$key || !$this->application = app(AppService::class)->init($key, $force)) { throw new NotExistException('应用不存在或已被删除'); } elseif ($this->application->status != 0) { throw new NotExistException('应用已被屏蔽所有功能, 无法使用'); } return $this->application; } /** * 初始化后端用户 * * @param string $key * @param boolean $force * @return Account */ public function initAccount() { if ($this->account) { return $this->account; } return app('auth:admin')->authenticate(); } /** * 初始化前端用户 * * @param string $key * @param boolean $force * @return User */ public function initUser() { if ($this->user) { return $this->user; } return app('auth:user')->authenticate(); } /** * 获取站点配置 * * @return array */ public function getConfig($key = null) { } /** * 设置站点配置 * * @param string $key; * @param string|array $value; * * @return boolean */ public function setConfig($key, $value) { } /** * Set 账号实例 * * @param Account $account 账号实例 * * @return self */ public function setAccount(Account $account) { $this->account = $account; return $this; } /** * Set 用户实例 * * @param User $user 用户实例 * * @return self */ public function setUser(User $user) { $this->user = $user; return $this; } }