fix: 修复 jwt_service.py 错误的 settings 导入路径导致登录 401

- packages.config.settings 模块不存在,改为 from app.config import settings
- 此 bug 导致 JWT token 生成时 ModuleNotFoundError,被 except 捕获后返回通用 401
This commit is contained in:
2026-06-27 17:17:38 +08:00
parent a6e85092ce
commit a5c5da50c6
2 changed files with 22 additions and 22 deletions
Executable → Regular
+21 -21
View File
@@ -72,14 +72,14 @@ services:
# =========================================
# 资源限制建议(生产环境建议启用)
# =========================================
# deploy:
# resources:
# limits:
# cpus: '2.0'
# memory: 2G
# reservations:
# cpus: '0.5'
# memory: 512M
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# =========================================
# Worker 服务(Celery 任务队列)
@@ -112,14 +112,14 @@ services:
# 资源限制建议(生产环境建议启用)
# =========================================
# 注意: Worker 需要处理视频,建议分配更多资源
# deploy:
# resources:
# limits:
# cpus: '2.0'
# memory: 4G
# reservations:
# cpus: '0.5'
# memory: 1G
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '0.5'
memory: 1G
# =========================================
# Web 服务(Nginx + 前端静态文件)
@@ -159,11 +159,11 @@ services:
# =========================================
# 资源限制建议
# =========================================
# deploy:
# resources:
# limits:
# cpus: '0.5'
# memory: 256M
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
# ===========================================
# 共享卷配置
+1 -1
View File
@@ -229,7 +229,7 @@ _jwt_service_instance = None
def _get_jwt_service():
global _jwt_service_instance
if _jwt_service_instance is None:
from packages.config.settings import settings
from app.config import settings
kw = dict(secret_key=settings.JWT_SECRET_KEY)
if hasattr(settings, "JWT_ALGORITHM"):
kw["algorithm"] = settings.JWT_ALGORITHM