保定ai问答主体项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
bd_ai_fastapi/app/utils/jwt_utils.py

10 lines
297 B

import jwt
from app.schemas.login import JWTPayload
from app.settings.config import settings
def create_access_token(*, data: JWTPayload):
payload = data.model_dump().copy()
encoded_jwt = jwt.encode(payload, settings.SECRET_KEY, algorithm=settings.JWT_ALGORITHM)
return encoded_jwt