SettingController.php 2.7 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\businessapi\controller;
  20. use app\adminapi\validate\ResetPasswordValidate;
  21. use app\businessapi\validate\ShopSettingsValidate;
  22. use app\businessapi\logic\SettingLogic;
  23. /**
  24. * 配置逻辑类
  25. * Class SettingController
  26. * @package app\businessapi\controller
  27. */
  28. class SettingController extends BaseBusinesseController
  29. {
  30. /**
  31. * @notes 获取店铺配置
  32. * @return array
  33. * @author cjhao
  34. * @date 2023/2/16 14:35
  35. */
  36. public function getShopConfig()
  37. {
  38. $config = (new SettingLogic())->getShopConfig();
  39. return $this->data($config);
  40. }
  41. /**
  42. * @notes 设置店铺配置
  43. * @return \think\response\Json
  44. * @author cjhao
  45. * @date 2023/2/16 14:38
  46. */
  47. public function setShopConfig()
  48. {
  49. $params = (new ShopSettingsValidate())->post()->goCheck();
  50. (new SettingLogic())->setShopConfig($params);
  51. return $this->success('设置成功');
  52. }
  53. /**
  54. * @notes 设置用户信息
  55. * @return \think\response\Json
  56. * @author cjhao
  57. * @date 2023/2/16 14:45
  58. */
  59. public function getAdminInfo()
  60. {
  61. $info = (new SettingLogic())->getAdminInfo($this->adminId);
  62. return $this->data($info);
  63. }
  64. /**
  65. * @notes 修改管理员密码
  66. * @return \think\response\Json
  67. * @author cjhao
  68. * @date 2022/4/21 15:16
  69. *
  70. */
  71. public function resetPassword(){
  72. $params = (new ResetPasswordValidate())->post()->goCheck(null,['admin_id'=>$this->adminId]);
  73. $result = (new SettingLogic())->resetPassword($params,$this->adminId);
  74. if(true === $result){
  75. return $this->success('密码修改成功',[],1,1);
  76. }
  77. return $this->fail($result);
  78. }
  79. }