jwt-auth根据token反解析出用户信息

token解密使用authenticate方法,注意要先setToken:


use Tymon\JWTAuth\JWTAuth;
 
class VerifySign extends JWTAuth
{
    
    
    public function getUserInfo($token)
    {
    
    
          $this->setToken($token);
          $user = $this->authenticate();
          reutrn $user;
    }
}

猜你喜欢

转载自blog.csdn.net/qq175023117/article/details/107403876