VerifyCode.php 1016 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 验证器
  13. */
  14. class VerifyCode extends Validate
  15. {
  16. protected $rule = [
  17. 'verify_code' => 'require|length:6',
  18. 'verify_code_type' => 'require|in:1,2,3',
  19. ];
  20. protected $message = [
  21. 'verify_code.require' => '验证码必填',
  22. 'verify_code.length' => '验证码长度为6位',
  23. 'verify_code_type.require' => '验证码类型必填',
  24. 'verify_code_type.in' => '验证码类型错误',
  25. ];
  26. protected $scene = [
  27. 'verify_code_search' => ['verify_code'],
  28. 'verify_code_send' => ['verify_code_type'],
  29. ];
  30. }