data($result); } /** * @notes 全局配置 * @return Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/9/21 19:41 */ public function config() { $result = IndexLogic::getConfigData(); return $this->data($result); } /** * Notes: 获取分享信息 * @author 张无忌(2021/1/20 17:04) * @return array|mixed|string */ public function share() { $client = $this->request->get('client', Client_::mnp, 'intval'); $config = []; switch ($client) { case Client_::mnp: $config = ConfigServer::get('share', 'mnp', [ 'mnp_share_title' => '', 'mnp_share_image' => '' ]); if (!empty($config['mnp_share_image']) and $config['mnp_share_image'] !== '') { $config['mnp_share_image'] = UrlServer::getFileUrl($config['mnp_share_image']); } break; case Client_::oa: $config = ConfigServer::get('share', 'h5', [ 'h5_share_title' => '', 'h5_share_intro' => '', 'h5_share_image' => '' ]); if (!empty($config['h5_share_image']) and $config['h5_share_image'] !== '') { $config['h5_share_image'] = UrlServer::getFileUrl($config['h5_share_image']); } break; case Client_::android: case Client_::ios: $config = ConfigServer::get('share', 'app', [ 'app_share_title' => '', 'app_share_intro' => '', 'app_share_image' => '' ]); if (!empty($config['app_share_image']) and $config['app_share_image'] !== '') { $config['app_share_image'] = UrlServer::getFileUrl($config['app_share_image']); } break; } return $this->success('获取成功', $config); } /** * @notes 政策协议 * @return Json * @author 段誉 * @date 2022/9/20 20:00 */ public function policy() { $type = $this->request->get('type/s', ''); $result = IndexLogic::getPolicyByType($type); return $this->data($result); } /** * @notes 装修信息 * @return Json * @author 段誉 * @date 2022/9/21 18:37 */ public function decorate() { $id = $this->request->get('id/d'); $result = IndexLogic::getDecorate($id); return $this->data($result); } }