Admin.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 Admin extends Validate
  16. {
  17. protected $rule = [
  18. 'admin_name'=>'require|length:3,12',
  19. 'admin_password'=>'require|min:6',
  20. 'admin_gid'=>'require',
  21. 'captcha'=>'require|min:3',
  22. ];
  23. protected $message = [
  24. 'admin_name.require'=>'登录名必填',
  25. 'admin_name.length'=>'登录名长度在3到12位',
  26. 'admin_password.require'=>'密码为必填',
  27. 'admin_password.min'=>'密码长度至少为6位',
  28. 'admin_gid.require'=>'权限组为必填',
  29. 'captcha.require'=>'验证码为必填',
  30. 'captcha.min'=>'验证码长度至少为3位',
  31. ];
  32. protected $scene = [
  33. 'admin_add' => ['admin_name', 'admin_password', 'admin_gid'],
  34. 'index' => ['admin_name', 'admin_password', 'captcha'],//login index
  35. ];
  36. }