MiniProgramSettingController.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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\wechat;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\wechat\UploadMnpLogLists;
  22. use app\adminapi\logic\wechat\MiniProgramSettingLogic;
  23. use app\adminapi\validate\wechat\MiniProgramSettingValidate;
  24. /**
  25. * 微信小程序设置控制器
  26. * Class MiniProgramSettingController
  27. * @package app\adminapi\controller\wechat
  28. */
  29. class MiniProgramSettingController extends BaseAdminController
  30. {
  31. /**
  32. * @notes 获取微信小程序设置
  33. * @return \think\response\Json
  34. * @author Tab
  35. * @date 2021/7/28 18:34
  36. */
  37. public function getConfig()
  38. {
  39. $result = MiniProgramSettingLogic::getConfig();
  40. return $this->data($result);
  41. }
  42. /**
  43. * @notes 微信小程序设置
  44. * @return \think\response\Json
  45. * @author Tab
  46. * @date 2021/7/28 19:01
  47. */
  48. public function setConfig()
  49. {
  50. $params = (new MiniProgramSettingValidate())->post()->goCheck();
  51. MiniProgramSettingLogic::setConfig($params);
  52. return $this->success('设置成功', [], 1, 1);
  53. }
  54. /**
  55. * @notes 上传小程序代码
  56. * @return \think\response\Json
  57. * @author ljj
  58. * @date 2025/4/9 下午3:08
  59. */
  60. public function uploadMnp()
  61. {
  62. $params = $this->request->post();
  63. $params['admin_id'] = $this->adminId;
  64. $result = (new MiniProgramSettingLogic())->uploadMnp($params);
  65. if(false === $result) {
  66. return $this->fail(MiniProgramSettingLogic::getError());
  67. }
  68. return $this->success('操作成功',[],1,1);
  69. }
  70. /**
  71. * @notes 上传小程序代码日志列表
  72. * @return \think\response\Json
  73. * @author ljj
  74. * @date 2025/4/9 下午4:15
  75. */
  76. public function uploadMnpLogLists()
  77. {
  78. return $this->dataLists(new UploadMnpLogLists());
  79. }
  80. }