You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
551 B

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class Token extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['token', 'require|max:128','token必填|token不能超过128个字符'],
  10. ['type', 'in:0,1,2,3,4,5,6','token类型,0:app, 1:admin, 2:weixin, 3:wap, 4: pc'],
  11. ['uid', 'require|number','uid必填|uid必须是数字'],
  12. ];
  13. protected $scene = [
  14. 'add' => ['token', 'type', 'uid'],
  15. 'del' => ['id'],
  16. ];
  17. }