UserValidate.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\admin\user;
  12. use think\Validate;
  13. class UserValidate extends Validate
  14. {
  15. /**
  16. * 定义验证规则
  17. * 格式:'字段名' => ['规则1','规则2'...]
  18. *
  19. * @var array
  20. */
  21. protected $rule = [
  22. 'pwd' => 'require|length:4,64',
  23. ];
  24. /**
  25. * 定义错误信息
  26. * 格式:'字段名.规则名' => '错误信息'
  27. *
  28. * @var array
  29. */
  30. protected $message = [
  31. 'pwd.require' => '请填写密码',
  32. 'pwd.length' => '密码4-64长度字符',
  33. ];
  34. }