123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <?php
- // +----------------------------------------------------------------------
- // | Niucloud-admin 企业快速开发的saas管理平台
- // +----------------------------------------------------------------------
- // | 官方网址:https://www.niucloud.com
- // +----------------------------------------------------------------------
- // | niucloud团队 版权所有 开源版本可自由商用
- // +----------------------------------------------------------------------
- // | Author: Niucloud Team
- // +----------------------------------------------------------------------
- namespace app\adminapi\controller\sys;
- use app\service\admin\sys\ConfigService;
- use core\base\BaseAdminController;
- use think\Response;
- class Config extends BaseAdminController
- {
- /**
- * 获取网站设置
- * @return Response
- */
- public function getWebsite()
- {
- return success(( new ConfigService() )->getWebSite());
- }
- /**
- * 网站设置
- * @return Response
- */
- public function setWebsite()
- {
- $data = $this->request->params([
- ['site_name', ''],
- ['logo', ''],
- ['keywords', ''],
- ['desc', ''],
- ['latitude', ''],
- ['longitude', ''],
- ['province_id', 0 ],
- ['city_id', 0 ],
- ['district_id', 0 ],
- ['address', ''],
- ['full_address', ''],
- ['phone', ''],
- ['business_hours', ''],
- ['site_name', ''],
- ['logo', ''],
- ['front_end_name', ''],
- ['front_end_logo', ''],
- ['icon', '']
- ]);
- $this->validate($data, 'app\validate\site\Site.admin_set');
- ( new ConfigService() )->setWebSite($data);
- $service_data = $this->request->params([
- ['wechat_code', ''],
- ['enterprise_wechat', ''],
- ['tel', ''],
- ]);
- ( new ConfigService() )->setService($service_data);
- return success();
- }
- /**
- * 获取版权信息
- * @return Response
- */
- public function getCopyright()
- {
- return success(( new ConfigService() )->getCopyright());
- }
- /**设置版权信息
- * @return Response
- */
- public function setCopyright()
- {
- $data = $this->request->params([
- [ 'icp', '' ],
- [ 'gov_record', '' ],
- [ 'gov_url', '' ],
- [ 'market_supervision_url', '' ],
- [ 'logo', '' ],
- [ 'company_name', '' ],
- [ 'copyright_link', '' ],
- [ 'copyright_desc', '' ],
- ]);
- ( new ConfigService() )->setCopyright($data);
- return success();
- }
- /**
- * 场景域名
- * @return Response
- */
- public function getSceneDomain()
- {
- return success(( new ConfigService() )->getSceneDomain());
- }
- /**
- * 获取服务信息
- * @return Response
- */
- public function getServiceInfo()
- {
- return success(( new ConfigService() )->getService());
- }
- /**设置版权信息
- * @return Response
- */
- public function setMap()
- {
- $data = $this->request->params([
- [ 'key', '' ],
- [ 'is_open', 0 ], // 是否开启定位
- [ 'valid_time', 0 ] // 定位有效期/分钟,过期后将重新获取定位信息,0为不过期
- ]);
- ( new ConfigService() )->setMap($data);
- return success();
- }
- /**
- * 获取地图设置
- * @return Response
- */
- public function getMap()
- {
- return success(( new ConfigService() )->getMap());
- }
- /**
- * 获取站点首页列表(如果正在使用is_use = 1)
- */
- public function getSiteIndexList()
- {
- return success(( new ConfigService() )->getSiteIndexList());
- }
- /**
- * 首页配置
- */
- public function setSiteIndex()
- {
- $data = $this->request->params([
- [ 'view_path', '' ],
- ]);
- ( new ConfigService() )->setSiteIndexConfig($data);
- return success();
- }
- /**
- * 获取站点首页列表(如果正在使用is_use = 1)
- */
- public function getAdminIndexList()
- {
- return success(( new ConfigService() )->getAdminIndexList());
- }
- /**
- * 首页配置
- */
- public function setAdminIndex()
- {
- $data = $this->request->params([
- [ 'view_path', '' ],
- ]);
- ( new ConfigService() )->setAdminIndexConfig($data);
- return success();
- }
- /**
- * 获取手机端首页列表
- */
- public function getWapIndexList()
- {
- $data = $this->request->params([
- [ 'title', '' ],
- [ 'key', '' ] // 多个查询,逗号隔开
- ]);
- return success(( new ConfigService() )->getWapIndexList($data));
- }
- /**
- * 设置快捷菜单
- */
- public function setShortcutMenu()
- {
- $data = $this->request->params([
- [ 'menu', [] ],
- ]);
- ( new ConfigService() )->setShortcutMenu($data[ 'menu' ]);
- return success();
- }
- /**
- * 获取站点快捷菜单
- */
- public function getShortcutMenu()
- {
- return success(data: ( new ConfigService() )->getShortcutMenu());
- }
- /**
- * 获取开发者key
- * @return Response
- */
- public function getDeveloperToken()
- {
- return success(data: ( new ConfigService() )->getDeveloperToken());
- }
- /**
- * 设置开发者key
- * @return Response
- */
- public function setDeveloperToken()
- {
- $data = $this->request->params([
- [ 'token', '' ],
- ]);
- ( new ConfigService() )->setDeveloperToken($data);
- return success();
- }
- }
|