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 }) {