VerificationCode.php 657 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\admin\controller\sms;
  3. use app\admin\controller\BaseController;
  4. use app\admin\server\sms\VerificationCodeServer;
  5. class VerificationCode extends BaseController
  6. {
  7. /**
  8. * Notes:获取验证码
  9. * User: yym
  10. * Date: 2022/7/23
  11. */
  12. public function getCode()
  13. {
  14. $mobile = $this->request->get('mobile');
  15. $this->validateCheck('sms\VerificationCodeValidate',['mobile' => $mobile]);
  16. $user_id = $this->request->user_id ?? 0;
  17. $result = VerificationCodeServer::getCode($mobile, $user_id);
  18. if($result)
  19. {
  20. return json_success([], '发送成功');
  21. }
  22. }
  23. }