我有React本机应用程序,用于存储加密存储。但当我想从加密存储中获取值时,它会返回{"_h": 0, "_i": 0, "_j": null, "_k": null}
。有什么不对劲吗?我正在使用react本机加密存储
当从加密存储获取价值时,这是我的代码
export async function getToken() {
try {
return await EncryptedStorage.getItem('token');
} catch (error) {
}
}
我今天在异步存储方面遇到了类似的问题,但解决方案可能适用于您的问题。
试试这个:
return await EncryptedStorage.getItem('token').then((response) => {return response});