Config.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Niucloud-admin 企业快速开发的saas管理平台
  4. // +----------------------------------------------------------------------
  5. // | 官方网址:https://www.niucloud.com
  6. // +----------------------------------------------------------------------
  7. // | niucloud团队 版权所有 开源版本可自由商用
  8. // +----------------------------------------------------------------------
  9. // | Author: Niucloud Team
  10. // +----------------------------------------------------------------------
  11. namespace app\adminapi\controller\web;
  12. use app\service\admin\web\WebConfigService;
  13. use core\base\BaseAdminController;
  14. use think\Response;
  15. class Config extends BaseAdminController
  16. {
  17. /**
  18. * 获取电脑端设置
  19. * @return Response
  20. */
  21. public function getWebConfig()
  22. {
  23. return success((new WebConfigService())->getWebConfig());
  24. }
  25. /**
  26. * 电脑端设置
  27. * @return Response
  28. */
  29. public function setWebConfig()
  30. {
  31. $data = $this->request->params([
  32. [ 'is_show_shop', 0 ], //是否显示甄选好店模块
  33. [ 'shop_ad_image', '' ], //店铺广告图
  34. [ 'site_ids', [] ] //选择展示的店铺id
  35. ]);
  36. $this->validate($data, 'app\validate\web\WebConfig.set');
  37. (new WebConfigService())->setWebConfig($data);
  38. return success('MODIFY_SUCCESS');
  39. }
  40. }