ConfigController.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\controller;
  20. use app\adminapi\logic\auth\AuthLogic;
  21. use app\adminapi\logic\ConfigLogic;
  22. use app\adminapi\logic\gift_card\GiftCardLogic;
  23. use app\common\service\ConfigService;
  24. use think\facade\Config;
  25. /**
  26. * 配置控制器
  27. * Class ConfigController
  28. * @package app\adminapi\controller
  29. */
  30. class ConfigController extends BaseAdminController
  31. {
  32. public array $notNeedLogin = ['getConfig'];
  33. /**
  34. * @notes 获取配置
  35. * @return \think\response\Json
  36. * @author cjhao
  37. * @date 2021/8/19 16:29
  38. */
  39. public function getConfig()
  40. {
  41. $data = ConfigLogic::getConfig();
  42. return $this->data($data);
  43. }
  44. /**
  45. * @notes 获取首页视频设置配置
  46. * @return \think\response\Json
  47. * @author cjhao
  48. * @date 2021/8/19 16:29
  49. */
  50. public function getVedioConfig()
  51. {
  52. $data = ConfigLogic::getVedioConfig();
  53. return $this->data($data);
  54. }
  55. /**
  56. * @notes 获取首页视频设置配置
  57. * @return \think\response\Json
  58. * @author cjhao
  59. * @date 2021/8/19 16:29
  60. */public function setVedioConfig()
  61. {
  62. if($this->request->isPost()) {
  63. $params = request()->post();
  64. $is_vedio_show = $params['is_vedio_show']??'';
  65. $file_url = $params['file_url']??'';
  66. if(!in_array($is_vedio_show,[0,1])){
  67. return $this->fail('请传入是否首页显示视频!');
  68. }
  69. if($is_vedio_show==1){
  70. if(empty($file_url)){
  71. return $this->fail('请上传视频!');
  72. }
  73. }
  74. $result = ConfigLogic::setVedioConfig($params);
  75. if($result == 'true'){
  76. return $this->success('编辑成功!');
  77. }else{
  78. return $this->fail(GiftCardLogic::getError());
  79. }
  80. }else{
  81. return $this->fail('请求方式错误');
  82. }
  83. }
  84. /**
  85. * @notes 获取菜单
  86. * @return \think\response\Json
  87. * @author cjhao
  88. * @date 2021/8/25 17:46
  89. */
  90. public function getMenu()
  91. {
  92. $auth = AuthLogic::getMenu('menu');
  93. return $this->data($auth);
  94. }
  95. /**
  96. * @notes 获取权限
  97. * @return \think\response\Json
  98. * @author cjhao
  99. * @date 2021/8/25 19:32
  100. */
  101. public function getAuth()
  102. {
  103. $data = ConfigLogic::getAuth($this->adminInfo);
  104. return $this->data($data);
  105. }
  106. /**
  107. * @notes 获取营销模块接口
  108. * @return \think\response\Jon
  109. * @author cjhao
  110. * @date 2021/9/8 17:19
  111. */
  112. public function getMarketingModule()
  113. {
  114. $data = ConfigLogic::getMarketingModule();
  115. return $this->data($data);
  116. }
  117. /**
  118. * @notes 获取应用中心模块接口
  119. * @return \think\response\Json
  120. * @author cjhao
  121. * @date 2021/9/24 16:58
  122. */
  123. public function getAppModule()
  124. {
  125. $data = ConfigLogic::getAppModule();
  126. return $this->data($data);
  127. }
  128. /**
  129. * @notes 正版检测
  130. * @return \think\response\Json
  131. * @author ljj
  132. * @date 2023/5/16 11:49 上午
  133. */
  134. public function checkLegal()
  135. {
  136. $data = ConfigLogic::checkLegal();
  137. return $this->data($data);
  138. }
  139. }