Skip to content
New issue

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

有关JSONWebToken的问题 #1

Open
zkerpy opened this issue Apr 9, 2018 · 1 comment
Open

有关JSONWebToken的问题 #1

zkerpy opened this issue Apr 9, 2018 · 1 comment

Comments

@zkerpy
Copy link

zkerpy commented Apr 9, 2018

首页不完整显示数据,通过F12 查看是
{"detail":"Signature has expired."}
Google一下说需要在settings.py中配置了

import datetime
JWT_AUTH = {
    'JWT_EXPIRATION_DELTA': datetime.timedelta(seconds=300),
    'JWT_ALLOW_REFRESH': True,
    'JWT_REFRESH_EXPIRATION_DELTA': datetime.timedelta(days=7),
    'JWT_AUTH_HEADER_PREFIX': 'Token'
}

之后,首页就可以显示,但是进入个人中心,点击用户信息
{"detail":"身份认证信息未提供。"}
这个是未登录的错误,但是我是已登录的情况下
请大神解答一下

@rockyfire
Copy link

'JWT_AUTH_HEADER_PREFIX': 'JWT'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants