-
Notifications
You must be signed in to change notification settings - Fork 268
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
有时获取不到刚存的数据 #270
Comments
这么简单的场景,我觉得应该是你的代码逻辑问题。 我提出的改进建议:
export function setStorage(keyId,data,i){
...
...
return storage.save({
key: key,
data: data,
expires: i,
id: id
});
}
if (succ && succ.code === '0000') {
storage.remove({key:'token'}).then(() => {
setStorage('token', succ.content.token, tokenTime).then(() => {
getTempInfo("token").then((token) => {
//这里获取token
}
succallback();
})
})
} else {
errcallback(succ.message);
}
// 你也可以通 async await 语法,可以看起来更简洁
|
非常感谢您的回复!!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
场景是登录成功后保存token,然后用token去获取用户其他数据,但是后续拿到的token总是空的,多次重新登录都不行,除非重新安装应用。
测试环境从来没遇到,生产上Android、iPhone、iPad都遇到过,看代码没看出问题,很难复现。
依赖:
代码:
现在怀疑的地方:
有谁遇到或知道这个问题怎么解决吗?或有什么主意吗?辛苦帮忙回复,不胜感谢!!!
The text was updated successfully, but these errors were encountered: