fix: JWT 用户缓存避免每请求查库 + 移除全 API 限流

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-09 05:00:13 +08:00
parent 1f2a7a32af
commit 5d20c1ed97
3 changed files with 43 additions and 12 deletions

View File

@@ -191,10 +191,7 @@ REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_THROTTLE_CLASSES': [
'rest_framework.throttling.AnonRateThrottle',
'rest_framework.throttling.UserRateThrottle',
],
# 全局限流会作用于每个 API登录/支付等敏感接口在各自 view 上单独配置了 throttle_classes
'DEFAULT_THROTTLE_RATES': {
'anon': '100/minute',
'user': '1000/minute',