VerifyCode.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 验证器
  14. */
  15. class VerifyCode extends Validate
  16. {
  17. protected $rule = [
  18. 'verify_code'=>'require|length:6',
  19. 'verify_code_type'=>'require|in:1,2,3',
  20. ];
  21. protected $message = [
  22. 'verify_code.require' => '验证码必填',
  23. 'verify_code.length' => '验证码长度为6位',
  24. 'verify_code_type.require' => '验证码类型必填',
  25. 'verify_code_type.in' => '验证码类型错误',
  26. ];
  27. protected $scene = [
  28. 'verify_code_search' => ['verify_code'],
  29. 'verify_code_send' => ['verify_code_type'],
  30. ];
  31. }