QxSwitchValidate.php 928 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\v1\validate\center;
  3. use think\Validate;
  4. /**
  5. * 权限开关验证器
  6. */
  7. class QxSwitchValidate extends Validate
  8. {
  9. /**
  10. * 定义验证规则
  11. */
  12. protected $rule = [
  13. 'package_name' => 'require',
  14. 'qx' => 'require',
  15. 'ystc' => 'require',
  16. 'init' => 'require',
  17. ];
  18. /**
  19. * 定义错误信息
  20. */
  21. protected $message = [
  22. 'package_name' => '包名必须填写',
  23. 'qx' => '咨询允许获得必须填写',
  24. 'ystc' => '隐私弹窗必须填写',
  25. 'init' => '登录框同意勾选文案必须填写',
  26. ];
  27. /**
  28. * 定义场景
  29. */
  30. protected $scene = [
  31. 'save' => [
  32. 'package_name',
  33. 'qx',
  34. 'ystc',
  35. 'init',
  36. ],
  37. 'update' => [
  38. 'package_name',
  39. 'qx',
  40. 'ystc',
  41. 'init',
  42. ],
  43. ];
  44. }