revert: 撤回登录相关鉴权改动,恢复星阙原登录逻辑
UFO 登录问题应只在前端处理(登录请求不带旧 Token),不应改共享后端登录接口。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -61,7 +61,6 @@ import logging
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
class GetDynamicConfigView(APIView):
|
class GetDynamicConfigView(APIView):
|
||||||
authentication_classes = ()
|
|
||||||
permission_classes = [AllowAny]
|
permission_classes = [AllowAny]
|
||||||
parser_classes = [JSONParser]
|
parser_classes = [JSONParser]
|
||||||
|
|
||||||
|
|||||||
@@ -48,18 +48,9 @@ class ClubWechatLoginView(APIView):
|
|||||||
多俱乐部微信小程序登录(新接口,旧 /yonghu/wechatlogin 不变)。
|
多俱乐部微信小程序登录(新接口,旧 /yonghu/wechatlogin 不变)。
|
||||||
POST /jituan/auth/wechat-login
|
POST /jituan/auth/wechat-login
|
||||||
body: { code, club_id?, app_id? }
|
body: { code, club_id?, app_id? }
|
||||||
|
|
||||||
注意:必须完全跳过 JWT/权限/限流。
|
|
||||||
DRF 在 authentication_classes=[] 时若仍抛 AuthenticationFailed,
|
|
||||||
会因无 WWW-Authenticate 头被改写成 HTTP 403(前端显示「权限不足」)。
|
|
||||||
"""
|
"""
|
||||||
authentication_classes = ()
|
throttle_classes = [AnonRateThrottle]
|
||||||
permission_classes = ()
|
permission_classes = [AllowAny]
|
||||||
throttle_classes = ()
|
|
||||||
|
|
||||||
def initial(self, request, *args, **kwargs):
|
|
||||||
# 登录接口不做任何鉴权/权限/限流,避免 403「权限不足」
|
|
||||||
return
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
code = (request.data.get('code') or '').strip()
|
code = (request.data.get('code') or '').strip()
|
||||||
@@ -123,12 +114,8 @@ class ClubKefuLoginView(APIView):
|
|||||||
POST /jituan/auth/kefu-login
|
POST /jituan/auth/kefu-login
|
||||||
body: { phone, password, erjimima }
|
body: { phone, password, erjimima }
|
||||||
"""
|
"""
|
||||||
authentication_classes = ()
|
throttle_classes = [AnonRateThrottle]
|
||||||
permission_classes = ()
|
permission_classes = [AllowAny]
|
||||||
throttle_classes = ()
|
|
||||||
|
|
||||||
def initial(self, request, *args, **kwargs):
|
|
||||||
return
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
phone = (request.data.get('phone') or '').strip()
|
phone = (request.data.get('phone') or '').strip()
|
||||||
|
|||||||
@@ -103,13 +103,8 @@ class WechatMiniProgramLoginView(APIView):
|
|||||||
"""
|
"""
|
||||||
微信小程序登录接口
|
微信小程序登录接口
|
||||||
"""
|
"""
|
||||||
authentication_classes = ()
|
throttle_classes = [AnonRateThrottle]
|
||||||
permission_classes = ()
|
permission_classes = [AllowAny]
|
||||||
throttle_classes = ()
|
|
||||||
|
|
||||||
def initial(self, request, *args, **kwargs):
|
|
||||||
# 与 /jituan/auth/wechat-login 一致:登录绝不走 JWT,避免 403「权限不足」
|
|
||||||
return
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user