Comments (7)
helper.php把new改成app,通过header的方式也获取不到token?你的可以吗、
from jwt-auth.
这个问题,我找到原因了,被上面这大哥说什么重新实例化一个request类误导一上午,然后我打印请求,发现根本没有authorization这个header头,然后又百度了一下,发现是apache配置的问题,大家去百度apche获取不到authorization相关问题,就可以找到答案,真的烦一些不懂乱说了,浪费我一上午时间。
from jwt-auth.
由于在helper.php中初始化thans\jwt\provider\JWT类时重新生成了一个Request类导致通过header的方式获取到token,应该使用app("request")的方式从容器中获取request对象
获取是可以获取到的,写法确实不太好
from jwt-auth.
解决方法:https://blog.csdn.net/Dorisnzy/article/details/83143364
from jwt-auth.
@QThans helper.php中这个Request类改成app('request')吧。
from jwt-auth.
有强迫症,你不改了,老是觉得有问题。
from jwt-auth.
有强迫症,你不改了,老是觉得有问题。
改了改了
from jwt-auth.
Related Issues (20)
- 获取UID HOT 1
- create Token Error
- blacklist_grace_period 这个支持吗,应该怎么配置呢 HOT 2
- 返回payload是个Object,我怎么转换成数组呢? HOT 2
- Fatal error: Cannot instantiate interface thans\jwt\contract\Storage HOT 2
- 多台服务器的时候出现这个错误 HOT 5
- 改了接口方法么 HOT 1
- set方法参数对不上,导致黑名单的缓存时间没有用上,变成了永久缓存 HOT 1
- 刷新token时间是分钟为单位,这里有一处没有乘以60 HOT 1
- 已经设置了跨域情况下,在中间件 使用 JWTAuth::auth(); 方法提示跨域 HOT 1
- 安装不支持php8
- Could not create token :strpos() expects parameter 1 to be string, array given HOT 4
- thinkphp6.0+php8版本无法使用? HOT 2
- 文档里的JWTAuth::token()->get()应该是$tokenStr = JWTAuth::getToken()吧,是不是写错了 HOT 1
- 不支持php8.1 HOT 1
- 为啥还要引入qeq66/jwt HOT 3
- 在最新版Tp6中报错 HOT 3
- qeq66的包已经无法适配了,建议修复 HOT 3
- 不支持thinkphp6.2版本 HOT 1
- 找不到这个方法 案例内的无法使用 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwt-auth.