Compare commits

..

6 Commits

Author SHA1 Message Date
exinglang 55cdbd07f1 fix(push): 补齐小米通道与审核推送日志 2026-07-30 12:17:12 +08:00
exinglang 6ca8ca4ed2 Merge remote-tracking branch 'origin/main' into fix-pushlogxiaomi
# Conflicts:
#	app/integrations/vendor_push.py
2026-07-30 12:14:45 +08:00
exinglang 7474c2bebc fix(push): 补齐厂商请求日志参数 2026-07-30 10:26:26 +08:00
exinglang 7bfe703760 chore(tests): 取消推送测试文件改动 2026-07-30 10:25:05 +08:00
exinglang 69eeb43fe2 fix(push): 完善厂商推送参数与消息通知 2026-07-30 10:25:05 +08:00
exinglang a0196b8d64 fix(push): 完善厂商推送排障日志 2026-07-29 19:52:06 +08:00
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ admin_app = FastAPI(
# admin 前端独立部署。生产同域(nginx)无需 CORS;本地 next dev 跨域需放行开发源。
_dev_origins = [
"http://localhost:3001",
"http://127.0.0.1:3001",
"http://localhost:3002",
"http://127.0.0.1:3002",
"http://localhost:3000",
"http://127.0.0.1:3000",
]
+1 -1
View File
@@ -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, "发送过于频繁,请稍后再试"),
}
+1 -1
View File
@@ -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({
+1 -1
View File
@@ -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)