From dcdfe1382eea0e2124f08061d8e8592edd006bae Mon Sep 17 00:00:00 2001 From: sky121113 Date: Thu, 28 May 2026 11:42:57 +0800 Subject: [PATCH] =?UTF-8?q?[FIX]=20=E8=A7=A3=E6=B1=BA=20HTTPS=20=E7=92=B0?= =?UTF-8?q?=E5=A2=83=E4=B8=8B=20AJAX=20=E5=88=86=E9=A0=81=E8=AB=8B?= =?UTF-8?q?=E6=B1=82=20http=20=E6=B7=B7=E5=90=88=E5=85=A7=E5=AE=B9=20(Mixe?= =?UTF-8?q?d=20Content)=20=E6=94=94=E6=88=AA=20Bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 在 ads/index.blade.php 的 fetchPage 分頁異步請求中,新增主機與協議對齊邏輯 (urlObj.protocol = window.location.protocol),防止在 HTTPS 網頁中請求同域 http 分頁而被瀏覽器攔截。 2. 同步在 products/index.blade.php 的 AJAX 分頁切換重組中,對同域的請求協議進行 HTTPS 同步校正,解決混合內容載入失敗的問題。 --- resources/views/admin/ads/index.blade.php | 7 ++++++- resources/views/admin/products/index.blade.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/views/admin/ads/index.blade.php b/resources/views/admin/ads/index.blade.php index 95c834d..397d617 100644 --- a/resources/views/admin/ads/index.blade.php +++ b/resources/views/admin/ads/index.blade.php @@ -875,6 +875,11 @@ $baseRoute = 'admin.data-config.advertisements'; async fetchPage(url) { if (!url || url === window.location.href) return; + const urlObj = new URL(url, window.location.origin); + if (urlObj.host === window.location.host) { + urlObj.protocol = window.location.protocol; + } + url = urlObj.toString(); this.isLoading = true; try { @@ -1481,4 +1486,4 @@ $baseRoute = 'admin.data-config.advertisements'; })); }); -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/admin/products/index.blade.php b/resources/views/admin/products/index.blade.php index b022608..3b94873 100644 --- a/resources/views/admin/products/index.blade.php +++ b/resources/views/admin/products/index.blade.php @@ -1023,6 +1023,9 @@ hover:bg-slate-100 dark:hover:bg-white/5 rounded-lg flex items-center justify-be } else { // Ensure URL has tab and _ajax params const urlObj = new URL(url, window.location.origin); + if (urlObj.host === window.location.host) { + urlObj.protocol = window.location.protocol; + } urlObj.searchParams.set('tab', tab); urlObj.searchParams.set('_ajax', '1'); url = urlObj.toString();