laravel框架jwt登录报错 Could not create token
{"class":"Tymon\\JWTAuth\\Exceptions\\JWTException","message":"Could not create token: Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.","code":0,"file":"/app/vendor/tymon/jwt-auth/src/Providers/JWT/Lcobucci.php:113","previous":{"class":"ErrorException","message":"Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes.","code":0,"file":"/app/vendor/lcobucci/jwt/src/Builder.php:451"}}
解决办法1:
更新config/jwt.php文件
'jwt' => Tymon\JWTAuth\Providers\JWT\Namshi::class,
解决办法2:
lcobucci/jwt:3.4 has this problem, composer require lcobucci/jwt:3.3 can resolve it.
针对lumen的处理办法:
This solution should work for Laravel. If you need it for Lumen then create a new folder called config
in the root of the project and create a file called jwt.php
inside of it. Then copy the contents from this file in there: github.com/tymondesigns/jwt-auth/blob/1.0.0-beta.2/config/… Then go to your bootstrap\app.php
file and add this line in the Register Config Files section: $app->configure('jwt');
评论

React 18的并发渲染确实是个重大改进,我们在项目中已经升级使用,性能提升明显!