feat(ops): 下单与核销纳入接口访问百分比

总部可按成功百分比拦截现场提货、配送下单,以及扫码、手机号和弱网核销,规则写入 v4 文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-26 14:00:55 +08:00
parent 550697c346
commit d306ffaea8
12 changed files with 60 additions and 11 deletions
+5 -2
View File
@@ -1,9 +1,12 @@
import { REDEEM_WEAKNET_FAIL_THRESHOLD } from '@dukang/shared-types';
import { API_ACCESS_ERROR_KINDS, REDEEM_WEAKNET_FAIL_THRESHOLD } from '@dukang/shared-types';
import type { RedeemErrorClass, RedeemFailureReportResult } from '@dukang/shared-types';
import { request } from './api';
const API_ACCESS_DENIAL_REASONS = new Set<string>(API_ACCESS_ERROR_KINDS);
export function isNetworkError(e: unknown): boolean {
const err = e as Error & { status?: number };
const err = e as Error & { status?: number; reason?: string };
if (err.reason && API_ACCESS_DENIAL_REASONS.has(err.reason)) return false;
const status = err.status;
const message = (err.message ?? String(e)).toLowerCase();
if (status != null && status >= 500) return true;