// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\api\service; use app\api\model\h5\Setting as H5SettingModel; use app\common\library\helper; use app\common\service\BaseService; /** * 服务类:客户端公共数据 * Class Client * @package app\api\service */ class Client extends BaseService { /** * 客户端公共数据 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function getPublic(): array { return [ 'h5' => $this->getH5Public(), ]; } /** * 获取H5端公共数据 * @return array * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ private function getH5Public(): array { $values = H5SettingModel::getItem('basic'); return ['setting' => helper::pick($values, ['enabled', 'baseUrl'])]; } }