-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
🧐[问题] ant design pro v5 版本,使用localStorage不生效问题 #9386
Comments
以下的 Issues 可能会帮助到你 / The following issues may help you
|
这个对我没用 |
开了隐私模式? 这是浏览器提供的API 框架不会去改的 |
隐私模式? 怎么关闭? 我现在是刚拉取的代码,使用npx create-umi app命令获取的代码,我只是添加了一个localStorage的存储,其他的没改东西 |
我刚刚发现,登录的时候localStorage会存信息,但是我在切换菜单的时候,localStorage自动清理了,不知道为什么? |
This was referenced Jan 8, 2022
This was referenced Jan 21, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🧐 问题描述
我现在使用的是v5版本的,使用localStorage进行信息的存储,但是我发现localStorage无法存进去数据,我之前使用v4版本就是正常的
💻 示例代码
localStorage储存代码
/* 人工模拟缓存 */
export function setExpire(key, value, expire) {
const obj = {
data: value,
time: Date.now(),
expire
};
debugger
localStorage.setItem(key, JSON.stringify(obj));
}
🚑 其他信息
登录前
登录调用
登录后
The text was updated successfully, but these errors were encountered: