This commit is contained in:
qiangyanwen 2022-12-06 11:21:15 +08:00
parent 88dc74414e
commit c9b00a4f2e
1 changed files with 2 additions and 2 deletions

View File

@ -35,10 +35,10 @@ def create_token(data: dict, expire_time):
return token
oauth_scame = OAuth2PasswordBearer(tokenUrl="/api/login")
auth = OAuth2PasswordBearer(tokenUrl="/api/login")
def parse_token(token: str = Depends(oauth_scame)):
def parse_token(token: str = Depends(auth)):
token_exception = HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="token不正确或已过期",