Code Monkey home page Code Monkey logo

Comments (7)

leruge avatar leruge commented on June 6, 2024

helper.php把new改成app,通过header的方式也获取不到token?你的可以吗、

from jwt-auth.

leruge avatar leruge commented on June 6, 2024

这个问题,我找到原因了,被上面这大哥说什么重新实例化一个request类误导一上午,然后我打印请求,发现根本没有authorization这个header头,然后又百度了一下,发现是apache配置的问题,大家去百度apche获取不到authorization相关问题,就可以找到答案,真的烦一些不懂乱说了,浪费我一上午时间。

from jwt-auth.

QThans avatar QThans commented on June 6, 2024

由于在helper.php中初始化thans\jwt\provider\JWT类时重新生成了一个Request类导致通过header的方式获取到token,应该使用app("request")的方式从容器中获取request对象

获取是可以获取到的,写法确实不太好

from jwt-auth.

QThans avatar QThans commented on June 6, 2024

解决方法:https://blog.csdn.net/Dorisnzy/article/details/83143364

from jwt-auth.

leruge avatar leruge commented on June 6, 2024

@QThans helper.php中这个Request类改成app('request')吧。

from jwt-auth.

leruge avatar leruge commented on June 6, 2024

有强迫症,你不改了,老是觉得有问题。

from jwt-auth.

QThans avatar QThans commented on June 6, 2024

有强迫症,你不改了,老是觉得有问题。

改了改了

from jwt-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.