UserController.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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\controller\setting\user;
  15. use app\adminapi\{
  16. controller\BaseAdminController,
  17. logic\setting\user\UserLogic,
  18. validate\setting\UserConfigValidate
  19. };
  20. /**
  21. * 设置-用户设置控制器
  22. * Class UserController
  23. * @package app\adminapi\controller\config
  24. */
  25. class UserController extends BaseAdminController
  26. {
  27. /**
  28. * @notes 获取用户设置
  29. * @return \think\response\Json
  30. * @author 段誉
  31. * @date 2022/3/29 10:08
  32. */
  33. public function getConfig()
  34. {
  35. $result = (new UserLogic())->getConfig();
  36. return $this->data($result);
  37. }
  38. /**
  39. * @notes 设置用户设置
  40. * @return \think\response\Json
  41. * @author 段誉
  42. * @date 2022/3/29 10:08
  43. */
  44. public function setConfig()
  45. {
  46. $params = (new UserConfigValidate())->post()->goCheck('user');
  47. (new UserLogic())->setConfig($params);
  48. return $this->success('操作成功', [], 1, 1);
  49. }
  50. /**
  51. * @notes 获取注册配置
  52. * @return \think\response\Json
  53. * @author 段誉
  54. * @date 2022/3/29 10:08
  55. */
  56. public function getRegisterConfig()
  57. {
  58. $result = (new UserLogic())->getRegisterConfig();
  59. return $this->data($result);
  60. }
  61. /**
  62. * @notes 设置注册配置
  63. * @return \think\response\Json
  64. * @author 段誉
  65. * @date 2022/3/29 10:08
  66. */
  67. public function setRegisterConfig()
  68. {
  69. $params = (new UserConfigValidate())->post()->goCheck('register');
  70. (new UserLogic())->setRegisterConfig($params);
  71. return $this->success('操作成功', [], 1, 1);
  72. }
  73. }