From b61a3f46ee76f7e55552dd7c0d13ab4f3cb11890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=9F=E4=BA=8C=E8=BF=9C?= Date: Wed, 8 Apr 2026 14:55:52 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E8=B0=83=E6=95=B4=E9=80=82=E9=85=8D?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E9=98=BF=E9=87=8C=E4=BA=91=E6=95=88-002?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/api/client.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/web/src/api/client.ts b/web/src/api/client.ts index 8b5d4e95..19539f2d 100644 --- a/web/src/api/client.ts +++ b/web/src/api/client.ts @@ -249,27 +249,23 @@ export async function fetchText(input: RequestInfo | URL, init?: RequestInit): P function withBaseUrl(input: RequestInfo | URL): RequestInfo | URL { const baseUrl = getApiBaseUrl() - console.log('baseUrl', baseUrl) if (!baseUrl || typeof input !== 'string' || !input.startsWith('/')) { return input } - const url = new URL(input, ensureTrailingSlash(baseUrl)) - // console.log('url info = ', url) - return url + return `${baseUrl.replace(/\/+$/, '')}${input}` } export function buildApiUrl(path: string): string { const baseUrl = getApiBaseUrl() - console.log('baseUrl', baseUrl) if (!baseUrl) { return path } - return new URL(path, ensureTrailingSlash(baseUrl)).toString() + return `${baseUrl.replace(/\/+$/, '')}${path}` } -function ensureTrailingSlash(value: string): string { - return value.endsWith('/') ? value : `${value}/` -} +// function ensureTrailingSlash(value: string): string { +// return value.endsWith('/') ? value : `${value}/` +// } export async function getCurrentUser(): Promise { try {