MasterWokerController.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\workerapi\controller;
  3. use app\workerapi\logic\MasterWokerLogic;
  4. use app\workerapi\validate\MasterWokerValidate;
  5. class MasterWokerController extends BaseApiController
  6. {
  7. /**
  8. * @notes 修改密码
  9. * @return \think\response\Json
  10. * @author 段誉
  11. * @date 2022/9/20 19:16
  12. */
  13. public function changePassword()
  14. {
  15. $params = (new MasterWokerValidate())->post()->goCheck('changePassword');
  16. $result = MasterWokerLogic::changePassword($params, $this->userId);
  17. if (true === $result) {
  18. return $this->success('操作成功', [], 1, 1);
  19. }
  20. return $this->fail(MasterWokerLogic::getError());
  21. }
  22. /**
  23. * 更改手机号
  24. * @return void
  25. * @author 林海涛
  26. * @date 2024/7/10 下午2:23
  27. */
  28. public function changeMobile()
  29. {
  30. $params = (new MasterWokerValidate())->post()->goCheck('changeMobile');
  31. $result = MasterWokerLogic::changeMobile($params, $this->userId);
  32. if (true === $result) {
  33. return $this->success('操作成功', [], 1, 1);
  34. }
  35. return $this->fail(MasterWokerLogic::getError());
  36. }
  37. }