diff --git a/src/views/payment/receipt-claim-record.vue b/src/views/payment/receipt-claim-record.vue index 4b93166..362a0f3 100644 --- a/src/views/payment/receipt-claim-record.vue +++ b/src/views/payment/receipt-claim-record.vue @@ -202,8 +202,9 @@ export default { }, methods: { unwrapData(response) { - const body = response?.data || response || {}; - return body?.data || body; + // 数字 0 是合法返回值(如回写/同步 0 条),须用 ?? 判空避免 0 被信封对象顶掉导致 Number() 得 NaN + const body = response?.data ?? response ?? {}; + return body?.data ?? body; }, queryParams() { const transactionRange = this.query.transactionDateRange || []; diff --git a/src/views/payment/receipt-flow.vue b/src/views/payment/receipt-flow.vue index 1490efd..883eda2 100644 --- a/src/views/payment/receipt-flow.vue +++ b/src/views/payment/receipt-flow.vue @@ -295,8 +295,9 @@ export default { }, methods: { unwrapData(response) { - const body = response?.data || response || {}; - return body?.data || body; + // 数字 0 是合法返回值(如回写/同步 0 条),须用 ?? 判空避免 0 被信封对象顶掉导致 Number() 得 NaN + const body = response?.data ?? response ?? {}; + return body?.data ?? body; }, async loadTable() { this.loading = true;