-1
composer require firebase/php-jwt:^2.2

安装没问题

所以



    use \Firebase\JWT\JWT;
    $key = "example_key";
    $payload = array(
        "iss" => "http://example.org",
        "aud" => "http://example.com",
        "iat" => 1356999524,
        "nbf" => 1357000000
    );
    $jwt = JWT::encode($payload, $key);

错误

找不到类“Firebase\Jwt\Jwt”

帮我!!!

详细错误

细纹错误

谢谢你

4

1 回答 1

1

index.php 中的代码看起来不像您在此处编写的代码。尝试use \Firebase\JWT\JWT;在 index.php 中。此外,PHP 命名空间区分大小写,因此请确保您编写正确或使用 IDE 的自动完成功能。

于 2020-07-14T13:19:05.543 回答