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.
我使用 angular6 将响应保存在控制台的本地存储中。响应包含(Id 令牌、访问令牌、JWT 令牌)我想要访问令牌进行用户身份验证。我如何使用 angular 从本地存储中获取它。这是访问令牌
假设您已经使用Token:本地存储中调用的密钥存储了服务器响应。
Token:
var accessTokenObj = JSON.parse(localStorage.getItem("Token:")); console.log(accessTokenObj);