Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JWT 解码不工作
我已经尽我所能
let user_id = jwt.decode(req.body.auth_token).id;
req.body.auth_token 不为空,它正在返回令牌!
id也许您在解码令牌之前指的是属性。尝试这样做:
id
`const your_fnc = async (token) => { let user_id = await jwt.decode(req.body.auth_token) user_id = user_id.id }`
我在 React Native 的 AsyncStorage 中使用 JSON.Stringify ......现在我正在使用 this.setState 并且它正在工作:-D