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.
我的后端有 Django,前端有 vue。我使用 dj-rest-auth 进行身份验证,每次登录都会生成一个令牌密钥。我可以将其保存到 vuex,但我不确定如何识别用户?我正在建立一个博客,并且必须只允许作者编辑某些博客文章?我应该如何从令牌生成用户名,以便只有作者可以编辑它?
如果您尝试使用 JWT-auth - 尝试使用Djoser,这样就无法通过用户名检测令牌 - 您应该生成访问令牌和刷新令牌,您的访问令牌将过时 -在此处阅读更多