From f56fd5fd208444be86548aa6f63bd46e2c5a29ab Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Sat, 17 May 2025 14:50:39 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E4=BA=A4=E7=BC=BA=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/IndexController.php | 48 +++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/app/api/controller/IndexController.php b/app/api/controller/IndexController.php index c995480..0124016 100755 --- a/app/api/controller/IndexController.php +++ b/app/api/controller/IndexController.php @@ -16,6 +16,9 @@ namespace app\api\controller; use app\api\logic\IndexLogic; +use app\common\model\Client_; +use app\common\service\ConfigServer; +use app\common\service\UrlServer; use think\response\Json; @@ -28,7 +31,7 @@ class IndexController extends BaseApiController { - public array $notNeedLogin = ['index', 'config', 'policy', 'decorate']; + public array $notNeedLogin = ['index', 'config', 'policy', 'decorate','share']; /** @@ -62,6 +65,49 @@ class IndexController extends BaseApiController 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 政策协议