From 1733ae76e2253a57a25b22e6461eb45449d80647 Mon Sep 17 00:00:00 2001 From: celebrateyang Date: Sun, 8 Jun 2025 11:14:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E6=9F=A5=E4=B8=8D=E8=83=BD=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=A7=86=E9=A2=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/save/buttons/DownloadButton.svelte | 7 ++++--- web/src/lib/api/api.ts | 11 ++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/web/src/components/save/buttons/DownloadButton.svelte b/web/src/components/save/buttons/DownloadButton.svelte index 7dec3a36..2fb4555d 100644 --- a/web/src/components/save/buttons/DownloadButton.svelte +++ b/web/src/components/save/buttons/DownloadButton.svelte @@ -58,9 +58,10 @@ if (final.includes(state)) { setTimeout(() => changeDownloadButton("idle"), 1500); } - }; - - export const download = async (link: string) => { + }; export const download = async (link: string) => { + // Log the link being processed + console.log("[Cobalt BAM] Download button clicked for link:", link); + changeDownloadButton("think"); const response = await API.request(link); diff --git a/web/src/lib/api/api.ts b/web/src/lib/api/api.ts index 494cd569..5e1cfcd5 100644 --- a/web/src/lib/api/api.ts +++ b/web/src/lib/api/api.ts @@ -35,6 +35,10 @@ const request = async (url: string) => { alwaysProxy: getSetting("privacy", "alwaysProxy"), } + // Log the URL being submitted to the backend + console.log("[Cobalt BAM] Submitting URL to backend:", url); + console.log("[Cobalt BAM] Full request object:", request); + /*await apiOverrideWarning();*/ await getServerInfo(); @@ -76,9 +80,7 @@ const request = async (url: string) => { "Authorization": `Bearer ${session.token}`, }; } - } - - const response: Optional = await fetch(api, { + } const response: Optional = await fetch(api, { method: "POST", redirect: "manual", signal: AbortSignal.timeout(10000), @@ -101,6 +103,9 @@ const request = async (url: string) => { } }); + // Log the API response + console.log("[Cobalt BAM] API Response for URL", url, ":", response); + return response; }