-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 支持多标签页打开已经登录的系统后无需再登录并添加
7
天内免登录功能 (#747)
* feat: 支持多标签页打开已经登录的系统后无需再登录 * feat: 添加`7`天内免登录功能
- Loading branch information
1 parent
be2de40
commit 7e7b6fe
Showing
12 changed files
with
131 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7e7b6fe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改动点描述:
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