Platform.php 692 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\index\validate;
  3. use think\Validate;
  4. use think\Lang;
  5. class Platform extends Validate
  6. {
  7. // 验证规则.
  8. protected $rule = [
  9. 'platformId' => 'require|number|length:1,20',
  10. ];
  11. // 触犯规则提示语.
  12. protected $message = '';
  13. // 验证层.
  14. protected $scene = [
  15. 'platformToken' => ['platformId'],
  16. ];
  17. public function __construct() {
  18. $this->message = [
  19. //'user.require' => '用户名必须',
  20. //'user.alphaNum' => '用户名必须由字母和数组组成',
  21. //'user.length' => '用户名为6~20位',
  22. 'platformId' => lang('EP01001'),
  23. ];
  24. }
  25. }