diff --git a/app/Console/Commands/GenerateToken.php b/app/Console/Commands/GenerateToken.php new file mode 100644 index 0000000..05fdf84 --- /dev/null +++ b/app/Console/Commands/GenerateToken.php @@ -0,0 +1,49 @@ +ask('输入用户id'); + $user = User::find($userId); + if (!$user) { + return $this->error('用户不存在'); + } + $ttl = 365 * 24 * 60; + $this->info(\Auth::guard('api')->setTTL($ttl)->fromUser($user)); + } +}