From 0553e0682d1b0332872ceb4b9c20da448d428069 Mon Sep 17 00:00:00 2001 From: DanSnow Date: Thu, 10 Aug 2023 12:02:59 +0800 Subject: [PATCH] fix: fetch payload with origin --- packages/karbon/src/runtime/composables/storipress-payload.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/karbon/src/runtime/composables/storipress-payload.ts b/packages/karbon/src/runtime/composables/storipress-payload.ts index 0f5b2639..8ddfeb3c 100644 --- a/packages/karbon/src/runtime/composables/storipress-payload.ts +++ b/packages/karbon/src/runtime/composables/storipress-payload.ts @@ -26,7 +26,9 @@ async function loadStoripressPayloadWithRawURL(path: string, bypassCache = false return loadStoripressPayloadWithURLServer(path, bypassCache) } const { public: publicConfig } = useRuntimeConfig() - let modulePath = publicConfig.storipress?.payloadAbsoluteURL ? withBase(path, publicConfig.siteCDN) : path + let modulePath = publicConfig.storipress?.payloadAbsoluteURL + ? withBase(path, publicConfig.siteCDN) + : withBase(path, location.origin) if (bypassCache) { modulePath += `?t=${Date.now()}` }