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
获取用户信息函数有点看不明白
request.user.id 根据判断用户是否有登录,但是我在看前端代码时候,发现登录后返回一个token值,并没有user id的参数发起get的请求
The text was updated successfully, but these errors were encountered:
我的理解是, request 携带的token 通过验证之后, 这个 request.user 就是 user表的一个实例对象。 可以取出他的所有属性
Sorry, something went wrong.
获取用户信息函数有点看不明白 request.user.id 根据判断用户是否有登录,但是我在看前端代码时候,发现登录后返回一个token值,并没有user id的参数发起get的请求
request.user.id 是通过验证后放到request中的变量,具体看 django request 相关。token认证也是一种认证。
No branches or pull requests
获取用户信息函数有点看不明白
request.user.id 根据判断用户是否有登录,但是我在看前端代码时候,发现登录后返回一个token值,并没有user id的参数发起get的请求
The text was updated successfully, but these errors were encountered: