From 66ca9ad993c0655485e1233cfbb0c9a0d6a24e87 Mon Sep 17 00:00:00 2001 From: Mrx <18278715334@163.com> Date: Sat, 9 May 2026 18:16:43 +0800 Subject: [PATCH] f --- src/components/Payment.vue | 255 ++++++++++++++++++++++----------- src/composables/useApiFetch.js | 13 +- 2 files changed, 180 insertions(+), 88 deletions(-) diff --git a/src/components/Payment.vue b/src/components/Payment.vue index 00a63d8..b985303 100644 --- a/src/components/Payment.vue +++ b/src/components/Payment.vue @@ -26,10 +26,10 @@ 活动价:2折优惠 - +
- + @@ -38,7 +38,16 @@ - + + + + + + - - - - - -
@@ -67,9 +66,9 @@ diff --git a/src/composables/useApiFetch.js b/src/composables/useApiFetch.js index 0e8c604..e27c2a6 100644 --- a/src/composables/useApiFetch.js +++ b/src/composables/useApiFetch.js @@ -27,14 +27,11 @@ const useApiFetch = createFetch({ if (isWechat) { platform = "wxh5"; } - options.headers['X-Platform'] = platform - - if (token) { - options.headers = { - ...options.headers, - Authorization: `${token}`, - }; - } + options.headers = { + ...(options.headers || {}), + "X-Platform": platform, + ...(token ? { Authorization: `${token}` } : {}), + }; return { url, options }; }, async afterFetch({ data, response }) {