实现了.env加载

This commit is contained in:
carry 2025-01-22 13:48:01 +08:00
parent 2f1cf11d91
commit bb314a2c6b
2 changed files with 3 additions and 2 deletions

View File

@ -15,8 +15,8 @@ DATABASE_CONFIG = {
JWT_CONFIG = {
'secret_key': os.getenv('JWT_SECRET_KEY', 'your-secret-key'),
'algorithm': 'HS256',
'access_token_expire': timedelta(minutes=int(os.getenv('JWT_ACCESS_EXPIRE_MINUTES', '30'))),
'refresh_token_expire': timedelta(days=int(os.getenv('JWT_REFRESH_EXPIRE_DAYS', '7')))
'access_token_expire': timedelta(minutes=int(os.getenv('JWT_ACCESS_EXPIRE_MINUTES', '10'))),
'refresh_token_expire': timedelta(days=int(os.getenv('JWT_REFRESH_EXPIRE_DAYS', '3')))
}
# 日志配置

View File

@ -1,4 +1,5 @@
fastapi>=0.95.2
python-dotenv>=1.0.0
sqlalchemy>=2.0.15
passlib>=1.7.4
bcrypt>=4.0.1