We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
继续常规学习,充实,哈哈 💥
任务
在使用token做登录验证的时候,将后来发送过来的token保存在cookie、sessionStorage或者localStorage中,想要获取用户信息的时候,先拿到token,载发送给后端,进行解析token,查找用户,返回用户信息即可
可以有多种方式向后端发送token(前端axios发送请求,后端node接收并验证)
http://localhost:8080/auth/user?token=
The text was updated successfully, but these errors were encountered:
No branches or pull requests
继续常规学习,充实,哈哈 💥
任务
知识点
在使用token做登录验证的时候,将后来发送过来的token保存在cookie、sessionStorage或者localStorage中,想要获取用户信息的时候,先拿到token,载发送给后端,进行解析token,查找用户,返回用户信息即可
可以有多种方式向后端发送token(前端axios发送请求,后端node接收并验证)
前端:axios.get('/auth/user', {headers: {token: token}})
后端:req.headers.toke
http://localhost:8080/auth/user?token=
)前端: axios.get('/auth/user', {params: {token: token}})
后端: req.params.token
后端: req.body
The text was updated successfully, but these errors were encountered: