0

login如果我收到A token is required来自JWTException.

4

1 回答 1

0

您可以使用中间件检查令牌:

class CheckTokenMiddleware
{
    public function handle($request, Closure $next)
    {
        // Check token here.
        if (!checkToken($request->token)) {
            return redirect('login');
        }

        return $next($request);
    }
}
于 2019-04-28T03:19:27.777 回答