统一前后端代码格式化配置

This commit is contained in:
yml2213
2026-08-16 17:27:12 +08:00
parent 8705f6a6a1
commit 5c7c3e14e3
278 changed files with 6386 additions and 5500 deletions
@@ -107,11 +107,9 @@ export function notifyKuaishouCloudAssetNotEnough({
`商品:${String(skuName || binding.skuName || flowRecord.internalSkuName || '').trim() || '-'}`,
].join('\n'),
category: 'kuaishou_cloud_asset_not_enough',
cooldownKey: [
'kuaishou_cloud_asset_not_enough',
taskRecord.id || '',
binding.skuId || '',
].join(':'),
cooldownKey: ['kuaishou_cloud_asset_not_enough', taskRecord.id || '', binding.skuId || ''].join(
':',
),
})
}
@@ -135,9 +133,16 @@ export function notifyCloudtentaclesAuthExpired({
`接口:${String(pathname || '').trim() || '-'}`,
`错误码:${String(errorCode || '').trim() || '-'}`,
`原因:${String(message || '').trim() || '登录态已失效,请到后台重新登录'}`,
].filter(Boolean).join('\n'),
]
.filter(Boolean)
.join('\n'),
category: 'cloudtentacles_auth_expired',
cooldownKey: ['cloudtentacles_auth_expired', normalizedSourceKey || 'default', pathname, errorCode].join(':'),
cooldownKey: [
'cloudtentacles_auth_expired',
normalizedSourceKey || 'default',
pathname,
errorCode,
].join(':'),
cooldownMs: Number(cooldownSeconds || 600) * 1000,
})
}
@@ -161,9 +166,13 @@ export function notifyCloudtentaclesAssetLow({
`当前余额:${Number(asset || 0)}`,
`提醒阈值:${Number(threshold || 0)}`,
'请及时补充 cloudtentacles 余额,避免自动履约失败。',
].filter(Boolean).join('\n'),
]
.filter(Boolean)
.join('\n'),
category: 'cloudtentacles_asset_low',
cooldownKey: ['cloudtentacles_asset_low', normalizedSourceKey || 'default', threshold].join(':'),
cooldownKey: ['cloudtentacles_asset_low', normalizedSourceKey || 'default', threshold].join(
':',
),
cooldownMs: Number(cooldownSeconds || 1800) * 1000,
})
}
@@ -186,7 +195,11 @@ export function notifyOpen91PendingConfig({
`原因:${String(reason || '').trim() || '未命中履约配置'}`,
].join('\n'),
category: 'open91_pending_config',
cooldownKey: ['open91_pending_config', orderNo || orderRecord.platform_order_id || '', productNo].join(':'),
cooldownKey: [
'open91_pending_config',
orderNo || orderRecord.platform_order_id || '',
productNo,
].join(':'),
})
}
@@ -258,9 +271,7 @@ function formatTaskLine(task: unknown) {
}
function toRecord(value: unknown): JsonObject {
return value && typeof value === 'object' && !Array.isArray(value)
? value as JsonObject
: {}
return value && typeof value === 'object' && !Array.isArray(value) ? (value as JsonObject) : {}
}
function isNotificationCoolingDown(cooldownKey: unknown, cooldownMs = DEFAULT_COOLDOWN_MS) {