From f242953d949fbcbf730b0a1a8b418c41f12f5829 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 22 Feb 2026 13:45:40 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E5=91=83=E5=91=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- recharge.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recharge.php b/recharge.php index 28e9592..99452bd 100644 --- a/recharge.php +++ b/recharge.php @@ -414,7 +414,10 @@ window.lastRechargeStatus = null; // Helper to get relative API path correctly regardless of subdir const getApiPath = () => { - return 'api/'; + // Determine the path to the api directory relative to current location + const loc = window.location.pathname; + const isRoot = loc.endsWith('/') || loc.endsWith('index.php') || loc.endsWith('recharge.php'); + return isRoot ? 'api/' : '../api/'; }; async function updateRate() {