Token.php 767 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace app\common\facade;
  3. use think\Facade;
  4. use app\common\library\token\Driver;
  5. /**
  6. * Token 门面类
  7. * @see Driver
  8. * @method Driver get(string $token, bool $expirationException = true) static 获取 token 的数据
  9. * @method Driver set(string $token, string $type, int $user_id, int $expire = 0) static 设置 token
  10. * @method Driver check(string $token, string $type, int $user_id, bool $expirationException = true) static 检查token是否有效
  11. * @method Driver delete(string $token) static 删除一个token
  12. * @method Driver clear(string $type, int $user_id) static 清理一个用户的所有token
  13. */
  14. class Token extends Facade
  15. {
  16. protected static function getFacadeClass(): string
  17. {
  18. return 'app\common\library\Token';
  19. }
  20. }