fix: JWT认证兼容旧版user_id claim,解决客服后台401

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-01 11:36:12 +08:00
parent 47c6e3b024
commit 243ab5b817
2 changed files with 40 additions and 1 deletions

View File

@@ -165,7 +165,7 @@ AUTH_USER_MODEL = 'yonghu.UserMain'
# DRF配置也非常简单
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework_simplejwt.authentication.JWTAuthentication',
'utils.jwt_auth.YonghuidJWTAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',