彻底修复 lewan 自动发货问题-8-8

This commit is contained in:
yml2213
2026-08-08 23:08:05 +08:00
parent 7196752d44
commit 6e41d7e0db
10 changed files with 260 additions and 37 deletions
@@ -133,7 +133,9 @@ export async function resolveCloudtentaclesSkuByProductName(
cloudSkuPrice: Number(matchedSku.price || 0) || 0,
cloudSkuInventory: Number(matchedSku.inventory || 0) || 0,
cloudSourceKeys,
resolvedSourceKey: context.sourceKey,
// Matching only discovers compatible accounts. The fulfillment selector
// chooses the least-loaded account immediately before taking a number.
resolvedSourceKey: '',
deliveryItems: [
{
cloudSkuId,
@@ -168,6 +170,7 @@ function buildCloudtentaclesSourceContext(
return {
sourceKey,
accountLabel: String(source.label || sourceKey).trim() || sourceKey,
baseUrl: String(session?.baseUrl || source.baseUrl || '').trim(),
token,
deviceId: normalizeCloudtentaclesDeviceId(session?.deviceId || source.deviceId),
@@ -226,7 +229,7 @@ async function resolveOverrideMatch(
cloudSkuPrice: Number(firstSku.price || 0) || 0,
cloudSkuInventory: Number(firstSku.inventory || 0) || 0,
cloudSourceKeys,
resolvedSourceKey: context.sourceKey,
resolvedSourceKey: rule.sourceKey ? context.sourceKey : '',
deliveryItems,
skuSnapshot: {
overrideRuleId: rule.id,