diff --git a/app/integrations/sms/aliyun.py b/app/integrations/sms/aliyun.py index 1b49842..9cd7be0 100644 --- a/app/integrations/sms/aliyun.py +++ b/app/integrations/sms/aliyun.py @@ -35,7 +35,7 @@ _GC_THRESHOLD = 10000 # 超此阈值,send 时顺手清老于 # 发码错误码 → (HTTP 码, 用户提示)。未列出的一律 503(供应商不可用)。 _SEND_ERRORS: dict[str, tuple[int, str]] = { - "MOBILE_NUMBER_ILLEGAL": (400, "手机号无效"), + "MOBILE_NUMBER_ILLEGAL": (400, "请输入有效的手机号"), "BUSINESS_LIMIT_CONTROL": (429, "今日发送次数过多,请明天再试"), "FREQUENCY_FAIL": (429, "发送过于频繁,请稍后再试"), } diff --git a/app/integrations/sms/chuanglan.py b/app/integrations/sms/chuanglan.py index c9328aa..b3afd28 100644 --- a/app/integrations/sms/chuanglan.py +++ b/app/integrations/sms/chuanglan.py @@ -53,7 +53,7 @@ _GC_THRESHOLD = 10000 # 任一内存 dict 超此阈值,send 时顺手清过期 # 发码错误码(创蓝 `code`)→ (HTTP 码, 用户提示)。未列出的一律 503(供应商不可用)。 _SEND_ERRORS: dict[str, tuple[int, str]] = { "103": (429, "发送过于频繁,请稍后再试"), # 提交速度过快 - "107": (400, "手机号无效"), # 手机号码错误 + "107": (400, "请输入有效的手机号"), # 手机号码错误 } # 需运维介入的配置/开通/余额类错误:打 critical 日志(仍归 503)。 _SEND_CRITICAL_CODES = frozenset({ diff --git a/app/integrations/sms/jiguang.py b/app/integrations/sms/jiguang.py index 336a141..7406963 100644 --- a/app/integrations/sms/jiguang.py +++ b/app/integrations/sms/jiguang.py @@ -185,5 +185,5 @@ def _send_via_jiguang(phone: str, code: str) -> None: if ecode == 50009: # 极光侧超频 raise SmsError("发送过于频繁,请稍后再试", status_code=429) if ecode == 50006: # 手机号无效(schema 已挡格式,这里多是空号/停机) - raise SmsError("手机号无效", status_code=400) + raise SmsError("请输入有效的手机号", status_code=400) raise SmsError(f"短信发送失败(code={ecode})", status_code=503)