修正了小写手机键导致的问题

This commit is contained in:
TermiNexus committed 2026-06-19 12:11:00 +08:00
1 parent 1b0ee1ef95
commit 5a329ef5bc
4 files changed
+22 -22

No files matched your search

+2 -2
View File
@@ -995,7 +995,7 @@ class GetAdminZhanghaoView(APIView):
user = request.user
# 获取当前用户的手机号(CharField,字符串类型)
current_phone = getattr(user, 'phone', '')
current_phone = getattr(user, 'Phone', '')
if not current_phone:
return Response({
'code': 401,
@@ -1092,7 +1092,7 @@ class GetXiugaiJiluView(APIView):
user = request.user
# 获取当前用户的手机号(CharField,字符串)
current_phone = getattr(user, 'phone', '')
current_phone = getattr(user, 'Phone', '')
if not current_phone:
return Response({
'code': 401,
+1 -1
View File
@@ -5437,7 +5437,7 @@ class AdTongYiTuiKuanPingTai(APIView):
dangqianyonghu = request.user
# 3. 验证手机号是否匹配
if str(getattr(dangqianyonghu, 'phone', '')) != qianzhanghao:
if str(getattr(dangqianyonghu, 'Phone', '')) != qianzhanghao:
return Response(
{'code': 401, 'message': '身份验证失败', 'data': None},
status=status.HTTP_401_UNAUTHORIZED
+1 -1
View File
@@ -5064,7 +5064,7 @@ class AdShangpinNeiRongHuoQu(APIView):
# 验证phone字段匹配
if not hasattr(dangqianyonghu, 'Phone') or str(dangqianyonghu.Phone) != qianzhanghao:
logger.warning(
f"账号不匹配: 当前用户phone={getattr(dangqianyonghu, 'phone', '无')}, 前端账号={qianzhanghao}")
f"账号不匹配: 当前用户phone={getattr(dangqianyonghu, 'Phone', '无')}, 前端账号={qianzhanghao}")
return Response(
{'code': 401, 'message': '身份验证失败', 'data': None},
status=status.HTTP_401_UNAUTHORIZED
+18 -18
View File
@@ -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)