修正了小写手机键导致的问题
This commit is contained in:
@@ -6914,7 +6914,7 @@ class KefuGetOrderTypesView(APIView):
|
||||
current_user = request.user
|
||||
|
||||
# 2. 验证手机号一致性
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: 请求phone={phone}, 用户phone={current_user.Phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -7323,7 +7323,7 @@ class KefuChangeDashouView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -7462,7 +7462,7 @@ class KefuRecoverOrderView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
@@ -7533,7 +7533,7 @@ class KefuPlatformRefundView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -7814,7 +7814,7 @@ class KefuRejectRefundView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
@@ -7980,7 +7980,7 @@ class KefuMerchantRefundView(APIView):
|
||||
# 客服身份验证(同前,省略以节省篇幅,但实际必须完整)
|
||||
current_user = request.user
|
||||
# ... 验证
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
@@ -8118,7 +8118,7 @@ class KefuRejectSettlementView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -8231,7 +8231,7 @@ class KefuTransferHallView(APIView):
|
||||
|
||||
# 2. 客服身份验证(同前,略,但必须完整实现)
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
@@ -8299,7 +8299,7 @@ class KefuCancelDesignationView(APIView):
|
||||
|
||||
# 2. 客服身份验证(同前,略,但必须完整实现)
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
@@ -8376,7 +8376,7 @@ class KefuGetDashouListView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -8464,7 +8464,7 @@ class KefuGetDashouDetailView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -9005,7 +9005,7 @@ class KefuGetOrderDetailView(APIView):
|
||||
current_user = request.user
|
||||
|
||||
# 验证手机号
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
# 验证用户类型
|
||||
@@ -9146,7 +9146,7 @@ class KefuPunishmentDetailView(APIView):
|
||||
|
||||
# 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -9239,7 +9239,7 @@ class KefuPunishmentActionView(APIView):
|
||||
|
||||
# 客服身份验证(完整验证,此处略)
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
@@ -9366,7 +9366,7 @@ class KefuForceCompleteView(APIView):
|
||||
|
||||
# 1. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return Response({'code': 401, 'msg': '认证失败'})
|
||||
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
@@ -9837,7 +9837,7 @@ class KefuWithdrawDetailView(APIView):
|
||||
|
||||
# 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
@@ -9949,7 +9949,7 @@ class KefuWithdrawActionView(APIView):
|
||||
if not phone:
|
||||
return None, Response({'code': 401, 'msg': '手机号不能为空'}, status=status.HTTP_400_BAD_REQUEST)
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
return None, Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
if current_user.UserType not in ('kefu', 'admin'):
|
||||
return None, Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
@@ -10205,7 +10205,7 @@ class KefuPunishView(APIView):
|
||||
|
||||
# 2. 客服身份验证
|
||||
current_user = request.user
|
||||
if getattr(current_user, 'phone', '') != phone:
|
||||
if getattr(current_user, 'Phone', '') != phone:
|
||||
logger.warning(f"手机号不匹配: {phone}")
|
||||
return Response({'code': 401, 'msg': '认证失败'}, status=status.HTTP_401_UNAUTHORIZED)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user