gpt4 book ai didi

javascript - react native : How to remove token with AsyncStorage with JWT ?

转载 作者:数据小太阳 更新时间:2023-10-29 05:37:46 26 4
gpt4 key购买 nike

我目前正在使用 var jwt = require('jsonwebtoken'); 像这样存储我的 React Native token :

AsyncStorage.setItem('token', response.token)

而且我不确定这是否是 React Native 检查 token 是否已存储的正确方法,但在 Chrome 浏览器的开发人员工具中,在应用程序下,然后是存储的 Cookies 下,它显示了一个 token 及其值。

然后为了删除 token ,我执行以下操作:

AsyncStorage.removeItem('token')

但即使我刷新存储的 Cookies 页面, token 仍然显示。

它是否已被删除但我是否错误地查看了 token ,或者它根本没有被删除?如果是这样,我做错了什么?

提前致谢

最佳答案

只需使用 AsyncStorage.removeItem('token')。它对我有用。

关于javascript - react native : How to remove token with AsyncStorage with JWT ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39909593/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com