OpenSettingLogic.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\logic\channel;
  15. use app\common\logic\BaseLogic;
  16. use app\common\service\ConfigService;
  17. /**
  18. * 微信开放平台
  19. * Class AppSettingLogic
  20. * @package app\adminapi\logic\setting\app
  21. */
  22. class OpenSettingLogic extends BaseLogic
  23. {
  24. /**
  25. * @notes 获取微信开放平台设置
  26. * @return array
  27. * @author 段誉
  28. * @date 2022/3/29 11:03
  29. */
  30. public static function getConfig()
  31. {
  32. $config = [
  33. 'app_id' => ConfigService::get('open_platform', 'app_id', ''),
  34. 'app_secret' => ConfigService::get('open_platform', 'app_secret', ''),
  35. ];
  36. return $config;
  37. }
  38. /**
  39. * @notes 微信开放平台设置
  40. * @param $params
  41. * @author 段誉
  42. * @date 2022/3/29 11:03
  43. */
  44. public static function setConfig($params)
  45. {
  46. ConfigService::set('open_platform', 'app_id', $params['app_id'] ?? '');
  47. ConfigService::set('open_platform', 'app_secret', $params['app_secret'] ?? '');
  48. }
  49. }