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

使用add函数遇到的问题 #15

Open
zhaowweny opened this issue Feb 24, 2019 · 0 comments
Open

使用add函数遇到的问题 #15

zhaowweny opened this issue Feb 24, 2019 · 0 comments

Comments

@zhaowweny
Copy link

我的需求是为了不影响用户体验,不管数据是否过期先用存储的数据,如果过期了重新获取重新处理一遍,在处理的函数里面使用add函数时发现虽然判断语句内在storage的key 存在时不会set,但是我在add后发现通过get 返回值为true,导致我后面判断是否过期的条件语句内始终不会执行,而且过期时间也在更新,表明数据更新了。我把那个if的条件改成this.storage.getItem(key) 后也就是直接通过localstorage或者sessionstorage取值判断就正常了。

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

1 participant