Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

token验证很绕,影响性能 #1

Open
philzq opened this issue Nov 12, 2018 · 3 comments
Open

token验证很绕,影响性能 #1

philzq opened this issue Nov 12, 2018 · 3 comments

Comments

@philzq
Copy link

philzq commented Nov 12, 2018

jwt,token验证,token拿到用户名,然后通过用户名拿到用户想情,再通过用户详情的用户去拿token和输入的token比较,然后在用用户详情的用户和输入token拿到的用户名匹配,这个是不是很绕呀,有啥意义吗,

@philzq
Copy link
Author

philzq commented Nov 12, 2018

有了token是否存在验证和用户是否存在这两块验证不是就可以了嘛

@philzq
Copy link
Author

philzq commented Nov 12, 2018

token存储的入口就在登录那里,只要用户登录就将token存到了redis,就算客户端会生成token,redis里面没有也是过不去的,然后那个用户是否存在是用来防止啥的,登录了不就证明了用户已经存在了,这样会不会影响整体性能呢

@philzq
Copy link
Author

philzq commented Nov 12, 2018

token为什么不存数据库而存redis,不就是为了性能嘛,这样的效果感觉和验证token存在不存在效果一样,很多步骤可以省略了。。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant