SmsCaptcha.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
  8. // +----------------------------------------------------------------------
  9. // | Author: 萤火科技 <admin@yiovo.com>
  10. // +----------------------------------------------------------------------
  11. declare (strict_types = 1);
  12. namespace app\api\validate\passport;
  13. use think\Validate;
  14. /**
  15. * 验证类:发送短信验证码
  16. * Class SmsCaptcha
  17. * @package app\api\validate\passport
  18. */
  19. class SmsCaptcha extends Validate
  20. {
  21. /**
  22. * 验证规则
  23. * @var array
  24. */
  25. protected $rule = [
  26. // 图形验证码 (用户输入)
  27. 'captchaCode' => ['require'],
  28. // 图形验证码 (key)
  29. 'captchaKey' => ['require'],
  30. // 用户手机号
  31. 'mobile' => ['require'],
  32. ];
  33. /**
  34. * 验证提示
  35. * @var string[]
  36. */
  37. protected $message = [
  38. 'captchaCode.require' => '图形验证码code不能为空',
  39. 'captchaKey.require' => '图形验证码key不能为空',
  40. 'mobile.require' => '手机号不能为空',
  41. ];
  42. }