[FIX] 解決 HTTPS 環境下 AJAX 分頁請求 http 混合內容 (Mixed Content) 攔截 Bug
1. 在 ads/index.blade.php 的 fetchPage 分頁異步請求中,新增主機與協議對齊邏輯 (urlObj.protocol = window.location.protocol),防止在 HTTPS 網頁中請求同域 http 分頁而被瀏覽器攔截。 2. 同步在 products/index.blade.php 的 AJAX 分頁切換重組中,對同域的請求協議進行 HTTPS 同步校正,解決混合內容載入失敗的問題。
This commit is contained in:
parent
c3e60b8746
commit
dcdfe1382e
@ -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';
|
||||
}));
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@endsection
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user