Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

使用的shiro-redis-spring-boot-starter的包,但发现前后同一账户两次登录产生的不同token都能进行相关用户权限的操作,这显然不符合逻辑。理想的状态是,当用户再次登录后,只有新生成的token有效,这样防止用户在不同客户端登录忘记退出造成的问题,请问可以实现么?我是新手。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

数据库或者redis保存userId和token的对应关系。根据token读取userId,老token是读不到userId的,因为对应关系没了。也就实现了唯一登录


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...