fix: H5 fallback 仅在 NO_AUTH 时触发,其他错误正常抛出

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
erio
2026-03-06 22:35:23 +08:00
parent 0c6c6e0ea6
commit e2a6895bb7

View File

@@ -45,7 +45,9 @@ export class WxpayProvider implements PaymentProvider {
payer_client_ip: request.clientIp,
});
return { tradeNo: request.orderId, payUrl: h5Url };
} catch {
} catch (err) {
const msg = err instanceof Error ? err.message : '';
if (!msg.includes('NO_AUTH')) throw err;
// H5 未开通fallback 到 Native 扫码
}
}