changecase

This commit is contained in:
qiangyanwen 2022-12-06 11:19:47 +08:00
parent cbc0a83d99
commit 88dc74414e
2 changed files with 4 additions and 3 deletions

View File

@ -12,6 +12,7 @@ python-multipart = "^0.0.5"
uvicorn = "^0.17.6"
loguru = "^0.6.0"
alembic = "^1.7.7"
pyyaml = "^6.0"
[tool.poetry.dev-dependencies]

View File

@ -47,9 +47,9 @@ def parse_token(token: str = Depends(oauth_scame)):
try:
jwt_data = jwt.decode(token, settings.ACCESS.SECRET_KEY, algorithms=settings.ACCESS.ALGORITHM)
id = jwt_data.get("id")
if id is None or id == "":
user_id = jwt_data.get("id")
if user_id is None or user_id == "":
raise token_exception
except JWTError:
raise token_exception
return id
return user_id