StoreOutAccountValidate.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\outapi\validate;
  12. use think\Validate;
  13. class StoreOutAccountValidate extends Validate
  14. {
  15. protected $regex = ['account' => '/^[a-zA-Z0-9]{4,30}$/'];
  16. /**
  17. * @var string[]
  18. */
  19. protected $rule = [
  20. 'appid' => 'require|account',
  21. 'appsecret' => 'min:6|max:32',
  22. 'title' => 'max:120'
  23. ];
  24. /**
  25. * @var string[]
  26. */
  27. protected $message = [
  28. 'appid.require' => '400133',
  29. 'appid.account' => '400255',
  30. 'appsecret.min' => '410011',
  31. 'appsecret.max' => '410011',
  32. 'title.max' => '400761',
  33. ];
  34. protected $scene = [
  35. 'save' => ['appid', 'appsecret', 'title'],
  36. 'update' => ['appsecret', 'title'],
  37. ];
  38. }