ask('输入用户id'); $user = User::find($userId); if (!$user) { return $this->error('用户不存在'); } $ttl = 365 * 24 * 60; $this->info(\Auth::guard('api')->setTTL($ttl)->fromUser($user)); } }