fix: 登录接口彻底跳过鉴权,消除 403 权限不足
ClubWechatLoginView / WechatMiniProgramLoginView 覆盖 initial,不做 JWT/权限/限流;动态配置接口也不再解析坏 Token。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -48,10 +48,18 @@ class ClubWechatLoginView(APIView):
|
||||
多俱乐部微信小程序登录(新接口,旧 /yonghu/wechatlogin 不变)。
|
||||
POST /jituan/auth/wechat-login
|
||||
body: { code, club_id?, app_id? }
|
||||
|
||||
注意:必须完全跳过 JWT/权限/限流。
|
||||
DRF 在 authentication_classes=[] 时若仍抛 AuthenticationFailed,
|
||||
会因无 WWW-Authenticate 头被改写成 HTTP 403(前端显示「权限不足」)。
|
||||
"""
|
||||
authentication_classes = [] # 登录不走 JWT,避免旧 Token 触发 403
|
||||
throttle_classes = [AnonRateThrottle]
|
||||
permission_classes = [AllowAny]
|
||||
authentication_classes = ()
|
||||
permission_classes = ()
|
||||
throttle_classes = ()
|
||||
|
||||
def initial(self, request, *args, **kwargs):
|
||||
# 登录接口不做任何鉴权/权限/限流,避免 403「权限不足」
|
||||
return
|
||||
|
||||
def post(self, request):
|
||||
code = (request.data.get('code') or '').strip()
|
||||
|
||||
Reference in New Issue
Block a user