-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
StpLogicJwtForMixin+jwt+redis,调用注销函数logout()无效 #362
Comments
你前端是怎么提交token的? |
postman 加上请求头:token: Bearer xxxx.xxx.xxx,请求注销当前会话。 |
@click33 |
也不是完全没效果,是只清除 Session 数据,token 需要你在前端手动清理 |
@click33 http://pointborn.com/article/2020/10/9/1003.html 希望增加 token redis 白名单功能。 |
你说的就是第一种模式:Simple 模式 |
啊,我还以为 simple 模式只是用jwt来产生token仅此而已,以为会和不引入jwt效果一样,就一直没关注过simple模式。 |
@click33 但是我看logout方法里面也没有清除Session呀,调用完logout之后,再调用isLogin()仍然返回true,这不合理吧? |
@click33 目前在Mixin模式下,必须这样写才能完全登出: |
使用版本:
涉及的功能模块:
yml:
测试步骤:
postman
StpUtil.login(user_id)
进行登录。token: Bearer xxxx.xxx.xxx
,请求注销当前会话。为什么
logout
注销了,还是检测到已登录?并且,redis
的token
并没有被清除。再就,手动把
redis
的token
删除,StpUtil.checkLogin()
仍然不会抛出未登录异常。看了源码:
StpLogicJwtForMixin
中,logout()
没有被标记 [禁用],但是
logout(Object loginId, String device)
却被标记为 [禁用]。在
logout()
源码中的注释有一行// ...
,这就令人好奇了,其他地方都没有这样子的注释,就这个函数带有这个注释,不知道是我使用问题,还是
logout()
没有完善问题...IDEA debug模式调试了下,发现
StpLogicJwtForMixin
的logout()
函数内部的一系列调用,并没有任何涉及Redis
相关内容,好像
logout()
源码里并不存在对redis
进行清除或修改的操作。StpLogicJwtForMixin
源码这有两个相似问题,但是没有结果:#277 #188
The text was updated successfully, but these errors were encountered: