feat: 支持多标签页打开已经登录的系统后无需再登录并添加7
天内免登录功能
#747
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
改动点描述:
1. 将存储在
sessionStorage
的全部信息存储到localStorage
,平台默认不在sessionStorage
存储信息,主要为了支持多标签页打开已经登录的系统后无需再登录功能,因为sessionStorage
在多标签是不共享数据的,虽然有办法解决这个问题,但都不完美,尤其是在一个标签页修改了sessionStorage
里的信息后,为了别的标签页sessionStorage
信息保持一致,不得不去通知它,多了很多额外的代码,处理是比较麻烦的,所以这里建议大家如果有多标签共享信息的需求,就不要将信息存储到sessionStorage
了下面两个问题也就迎刃而解了
#682
#662
2. 添加
7
天内免登录功能。通过判断是否勾选登录页的7天内免登录
选项,对存在cookie
的multiple-tabs
设置过期时间。未勾选,过期时间默认为浏览器全部关闭销毁multiple-tabs
,已勾选,multiple-tabs
会在cookie
中存储7
天,浏览器全部关闭也不会销毁,除非手动清除演示视频
Kapture.2023-10-07.at.10.40.42.mp4