VerifyCode.php 782 B

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