fix: 链接页接单打手ID与指定打手分离,手机号改为选填

This commit is contained in:
XingQue
2026-07-04 00:04:22 +08:00
parent 432387982e
commit 0afeff8227
2 changed files with 8 additions and 5 deletions

View File

@@ -2242,6 +2242,7 @@ class KehuGetDingdanLianjieView(APIView):
'jieshao': dingdan_obj.Description or '',
'shangjia_mingcheng': shangjia_nicheng,
'zhuangtai': dingdan_obj.Status,
'jiedan_dashou_id': dingdan_obj.PlayerID or '',
# 新增配置字段
'kefu_link': kefu_link,
'oss_url': oss_url,
@@ -2260,7 +2261,7 @@ class KehuGetDingdanLianjieView(APIView):
pass
dingdan_info.update({
'youxi_nicheng': dingdan_obj.Nickname or '',
'zhiding_dashou': dingdan_obj.AssignedID or dingdan_obj.PlayerID or '',
'zhiding_dashou': dingdan_obj.AssignedID or '',
'beizhu': dingdan_obj.Remark or '',
'waibu_dingdan_id': dingdan_obj.ExternalOrderID or '',
'laoban_shouji': laoban_shouji,
@@ -2437,7 +2438,7 @@ class KehuTianxieDingdanView(APIView):
'data': None
}, status=status.HTTP_400_BAD_REQUEST)
ok_phone, msg_phone = validate_cn_mobile(laoban_shouji)
ok_phone, msg_phone = validate_cn_mobile(laoban_shouji, required=False)
if not ok_phone:
logger.warning(f"老板手机号校验失败 - IP: {client_ip}")
return Response({

View File

@@ -76,11 +76,13 @@ def validate_pdd_order_id(raw: str) -> tuple[bool, str]:
return True, ''
def validate_cn_mobile(raw: str) -> tuple[bool, str]:
"""中国大陆手机号校验。"""
def validate_cn_mobile(raw: str, required: bool = False) -> tuple[bool, str]:
"""中国大陆手机号校验;默认选填,空值通过"""
phone = str(raw or '').strip()
if not phone:
return False, '手机号不能为空'
if required:
return False, '手机号不能为空'
return True, ''
if not re.match(r'^1[3-9]\d{9}$', phone):
return False, '请输入正确的11位中国大陆手机号'
return True, ''