修复错误
This commit is contained in:
@@ -149,6 +149,11 @@ function applyEnvOverrides(baseConfig) {
|
||||
const claimBaseUrl = String(process.env.CLAIM_BASE_URL || '').trim()
|
||||
if (claimBaseUrl) {
|
||||
nextConfig.orders.claimBaseUrl = claimBaseUrl
|
||||
} else {
|
||||
const appBaseUrl = String(process.env.APP_BASE_URL || '').trim()
|
||||
if (appBaseUrl) {
|
||||
nextConfig.orders.claimBaseUrl = `${appBaseUrl.replace(/\/+$/, '')}/#/claim`
|
||||
}
|
||||
}
|
||||
|
||||
const tokenTtlHours = parseInteger(process.env.CLAIM_TOKEN_TTL_HOURS)
|
||||
|
||||
@@ -12,7 +12,7 @@ import { nowIso } from '../../utils/time.js'
|
||||
|
||||
export async function processAgisoTradeWebhook(requestLike) {
|
||||
const parsed = parseAgisoTradeRequest(requestLike)
|
||||
const webhookEvent = createWebhookEvent(buildWebhookEventInput(requestLike, parsed))
|
||||
const webhookEvent = await createWebhookEvent(buildWebhookEventInput(requestLike, parsed))
|
||||
|
||||
logWebhook('[webhook-service/agiso]', 'Webhook 已解析并写入 webhook_events', {
|
||||
requestId: requestLike.requestId || '',
|
||||
@@ -94,7 +94,7 @@ async function executeAgisoTradeWebhook(parsed, webhookEventId, { requestId = ''
|
||||
webhookEventId,
|
||||
})
|
||||
const result = await upsertOrderFromWebhook(enriched.parsed)
|
||||
updateWebhookEvent(webhookEventId, {
|
||||
await updateWebhookEvent(webhookEventId, {
|
||||
processed: true,
|
||||
process_error: '',
|
||||
related_order_id: result.order.id,
|
||||
@@ -140,7 +140,7 @@ async function executeAgisoTradeWebhook(parsed, webhookEventId, { requestId = ''
|
||||
})),
|
||||
}
|
||||
} catch (error) {
|
||||
updateWebhookEvent(webhookEventId, {
|
||||
await updateWebhookEvent(webhookEventId, {
|
||||
processed: false,
|
||||
process_error: error instanceof Error ? error.message : String(error || ''),
|
||||
related_order_id: null,
|
||||
|
||||
Reference in New Issue
Block a user