add test
This commit is contained in:
parent
88dc74414e
commit
c9b00a4f2e
|
|
@ -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不正确或已过期",
|
||||
|
|
|
|||
Loading…
Reference in New Issue