From a694ead4b8a474f7a78621bcb6a6a1c1b8d378dd Mon Sep 17 00:00:00 2001 From: bdim404 Date: Wed, 4 Feb 2026 13:18:39 +0800 Subject: [PATCH] refactor: Simplify audio URL handling in jobApi by removing redundant base URL concatenation --- qwen3-tts-frontend/src/lib/api.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qwen3-tts-frontend/src/lib/api.ts b/qwen3-tts-frontend/src/lib/api.ts index 887a3a9..b8b3a19 100644 --- a/qwen3-tts-frontend/src/lib/api.ts +++ b/qwen3-tts-frontend/src/lib/api.ts @@ -344,16 +344,14 @@ export const jobApi = { if (audioPath.startsWith('http')) { if (audioPath.includes('localhost') || audioPath.includes('127.0.0.1')) { const url = new URL(audioPath) - return `${import.meta.env.VITE_API_URL}${url.pathname}` + return url.pathname } return audioPath } else { - const baseUrl = import.meta.env.VITE_API_URL - const normalizedPath = audioPath.startsWith('/') ? audioPath : `/${audioPath}` - return `${baseUrl}${normalizedPath}` + return audioPath.startsWith('/') ? audioPath : `/${audioPath}` } } else { - return `${import.meta.env.VITE_API_URL}${API_ENDPOINTS.JOBS.AUDIO(id)}` + return API_ENDPOINTS.JOBS.AUDIO(id) } }, }