From da72c156e99e5d86113c854290d30ace1c4cab78 Mon Sep 17 00:00:00 2001 From: zxj Date: Thu, 27 Nov 2025 12:19:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E6=A0=A1=E9=AA=8C=E6=90=BA=E5=B8=A6=E7=BC=93?= =?UTF-8?q?=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/case/Detail.vue | 28 ++++++++++------------------ src/views/study/coursenew.vue | 28 ++++++++++------------------ 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/src/views/portal/case/Detail.vue b/src/views/portal/case/Detail.vue index 7ccef57f..c051c89c 100644 --- a/src/views/portal/case/Detail.vue +++ b/src/views/portal/case/Detail.vue @@ -563,26 +563,18 @@ export default { xmlhttp.abort(); }, 5000); // 1. 拼接随机参数(时间戳+随机数,确保URL唯一,破缓存) - // const url = - // window.location.protocol + - // "//uapi.boe.com.cn/500.html?t=" + - // Date.now() + - // Math.random(); + const url = + window.location.protocol + + "//uapi.boe.com.cn/500.html?t=" + + Date.now() + + Math.random(); // 2. 打开 HEAD 请求(URL已带随机参数) - //xmlhttp.open("HEAD", url, true); - - // 3. 设置禁用缓存的请求头(覆盖现代浏览器+老IE+代理) - // xmlhttp.setRequestHeader( - // "Cache-Control", - // "no-cache, no-store, must-revalidate" + xmlhttp.open("HEAD", url, true); + // xmlhttp.open( + // "HEAD", + // window.location.protocol + "//uapi.boe.com.cn/500.html", + // true // ); - // xmlhttp.setRequestHeader("Pragma", "no-cache"); // IE兼容 - // xmlhttp.setRequestHeader("Expires", "0"); // 禁止过期缓存复用 - xmlhttp.open( - "HEAD", - window.location.protocol + "//uapi.boe.com.cn/500.html", - true - ); xmlhttp.send(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4) { diff --git a/src/views/study/coursenew.vue b/src/views/study/coursenew.vue index 5fb4c8fb..3d79b795 100644 --- a/src/views/study/coursenew.vue +++ b/src/views/study/coursenew.vue @@ -1965,26 +1965,18 @@ export default { xmlhttp.abort(); }, 1000); // 1. 拼接随机参数(时间戳+随机数,确保URL唯一,破缓存) - // const url = - // window.location.protocol + - // "//uapi.boe.com.cn/500.html?t=" + - // Date.now() + - // Math.random(); + const url = + window.location.protocol + + "//uapi.boe.com.cn/500.html?t=" + + Date.now() + + Math.random(); // // 2. 打开 HEAD 请求(URL已带随机参数) - // xmlhttp.open("HEAD", url, true); - - // 3. 设置禁用缓存的请求头(覆盖现代浏览器+老IE+代理) - // xmlhttp.setRequestHeader( - // "Cache-Control", - // "no-cache, no-store, must-revalidate" + xmlhttp.open("HEAD", url, true); + // xmlhttp.open( + // "HEAD", + // window.location.protocol + "//uapi.boe.com.cn/500.html", + // true // ); - // xmlhttp.setRequestHeader("Pragma", "no-cache"); // IE兼容 - // xmlhttp.setRequestHeader("Expires", "0"); // 禁止过期缓存复用 - xmlhttp.open( - "HEAD", - window.location.protocol + "//uapi.boe.com.cn/500.html", - true - ); xmlhttp.send(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4) {