Token.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * lemocms
  4. * ============================================================================
  5. * 版权所有 2018-2027 lemocms,并保留所有权利。
  6. * 网站地址: https://www.lemocms.com
  7. * ----------------------------------------------------------------------------
  8. * 采用最新Thinkphp6实现
  9. * ============================================================================
  10. * Author: yuege
  11. * Date: 2019/8/2
  12. */
  13. namespace lemo\api\validate;
  14. use think\Validate;
  15. /**
  16. * 生成token参数验证器
  17. */
  18. class Token extends Validate
  19. {
  20. protected $rule = [
  21. 'appid' => 'require',
  22. 'mobile' => 'require',
  23. 'nonce' => 'require',
  24. 'timestamp' => 'number|require',
  25. 'sign' => 'require'
  26. ];
  27. protected $message = [
  28. 'appid.require' => 'appid不能为空',
  29. 'mobile.require' =>'mobile不能为空',
  30. 'nonce.require' => '随机数不能为空',
  31. 'timestamp.number' => '时间戳格式错误',
  32. 'sign.require' => '签名不能为空',
  33. ];
  34. }