From 8c50d2202cac3794980b98f978f4819af9b2a7a7 Mon Sep 17 00:00:00 2001 From: KUN1007 Date: Sun, 29 Oct 2023 19:07:16 +0800 Subject: [PATCH] BUG fixed: background image --- .env.development | 1 - src/hooks/useBackgroundPicture.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.env.development b/.env.development index 48008352..30217703 100644 --- a/.env.development +++ b/.env.development @@ -1,6 +1,5 @@ # Custom Environment Variables (Must be named with VITE_ prefix) -## Development Environment Address Prefix (usually '/' or './') TODO: VITE_API_UPLOADS_URL = `http://127.0.0.1:10007/uploads` VITE_API_BASE_URL = `http://127.0.0.1:10007/api` diff --git a/src/hooks/useBackgroundPicture.ts b/src/hooks/useBackgroundPicture.ts index 79d6c582..cc084bf6 100644 --- a/src/hooks/useBackgroundPicture.ts +++ b/src/hooks/useBackgroundPicture.ts @@ -10,8 +10,8 @@ const { showKUNGalgameBackground, showKUNGalgameCustomBackground } = // Fetch background image data from the backend const fetchGetBackground = async (imageName: string): Promise => { - const baseUrl = import.meta.env.VITE_API_BASE_URL - const url = `/uploads/image/bg/${imageName}.webp` + const baseUrl = import.meta.env.VITE_API_UPLOADS_URL + const url = `/image/bg/${imageName}.webp` const fullUrl = `${baseUrl}${url}` const response = await fetch(fullUrl, { method: 'GET',