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

[建议]用户增加过期功能 #200

Open
wshze opened this issue May 29, 2023 · 9 comments
Open

[建议]用户增加过期功能 #200

wshze opened this issue May 29, 2023 · 9 comments

Comments

@wshze
Copy link

wshze commented May 29, 2023

建议登录/注册页面增加一个关闭按钮
用户管理增加一个用户到期功能,或者至少加一个超时和token过期。

@Urmi10799
Copy link

yes, I was thinking about it. besides if user session is saved on server it would me more beneficial. server side session which also allow only one session at a time.

@Kerwin1202
Copy link
Member

建议登录/注册页面增加一个关闭按钮 用户管理增加一个用户到期功能,或者至少加一个超时和token过期。

用户 关闭 指的是 点击登录那个弹窗?

用户到期 指的是 给用户设置过期时间 之后无法使用以及登录? 这个超时和token 过期不太明白,可以具体说下需求,而不是只是说功能呢。

@Kerwin1202
Copy link
Member

yes, I was thinking about it. besides if user session is saved on server it would me more beneficial. server side session which also allow only one session at a time.

I don't quite understand what this means. Could it be that the Chinese translation I used is inaccurate?

@Fugitive844
Copy link

我自己部署的版本已经实现了,应该是一个帐号只能同时在一个地方登陆,另外超过一段时间不操作token直接过期。
1、只能一个地方登陆实现的思路是:登陆时保存用户的token信息到map(本次登陆会把上次登陆信息覆盖),用用户id做key,token做value,每次验证时从map中获取token和用户传入的token做比对,不存在或者匹配不上认为未登录。
2、超时未操作登陆失效:登陆成功后保存一个时间戳到map,后面每次调用接口时把时间戳和当前时间比对超过30分钟直接让token失效,未超时则更新时间戳为当前时间。
image
image

@Kerwin1202
Copy link
Member

这个作用是啥,单个设备功能我了解,但是目前没明白这其中的需求为什么要这个

@wshze
Copy link
Author

wshze commented May 30, 2023

1、关闭按钮就是点击注册/登录按钮后弹出的那个窗口页面没有关闭的选项(只能刷新页面,当然你会说关闭了又咋样,反正也用不了)。2、单个设备功能需求:账号密码泄露后(不知道已经泄露)任何人都能登录使用或者说我只想给你用,但是你把我账号却给了其他无数个人,哈哈。

@Fugitive844
Copy link

过期那个我也是个人有想法就加了,想着长时间不操作就退出登陆,这个看个人喜好了

@dqzboy
Copy link

dqzboy commented May 31, 2023

过期那个我也是个人有想法就加了,想着长时间不操作就退出登陆,这个看个人喜好了

搞个pr呀大佬 ^_^

@Fugitive844
Copy link

等我明天看看怎么弄,主要是自己改的有点多,不止这个东西

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

5 participants