AppSettingLogic.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. * App设置逻辑层
  19. * Class AppSettingLogic
  20. * @package app\adminapi\logic\setting\app
  21. */
  22. class AppSettingLogic extends BaseLogic
  23. {
  24. /**
  25. * @notes 获取App设置
  26. * @return array
  27. * @author 段誉
  28. * @date 2022/3/29 10:25
  29. */
  30. public static function getConfig()
  31. {
  32. $config = [
  33. 'ios_download_url' => ConfigService::get('app', 'ios_download_url', ''),
  34. 'android_download_url' => ConfigService::get('app', 'android_download_url', ''),
  35. 'download_title' => ConfigService::get('app', 'download_title', ''),
  36. ];
  37. return $config;
  38. }
  39. /**
  40. * @notes App设置
  41. * @param $params
  42. * @author 段誉
  43. * @date 2022/3/29 10:26
  44. */
  45. public static function setConfig($params)
  46. {
  47. ConfigService::set('app', 'ios_download_url', $params['ios_download_url'] ?? '');
  48. ConfigService::set('app', 'android_download_url', $params['android_download_url'] ?? '');
  49. ConfigService::set('app', 'download_title', $params['download_title'] ?? '');
  50. }
  51. }