363 lines
12 KiB
HTML
363 lines
12 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||
<meta http-equiv="Pragma" content="no-cache">
|
||
<meta http-equiv="Expires" content="0">
|
||
<title>🚨 紧急缓存清除 - DialogDescription错误修复</title>
|
||
<style>
|
||
* {
|
||
margin: 0;
|
||
padding: 0;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
body {
|
||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
|
||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||
min-height: 100vh;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 20px;
|
||
}
|
||
|
||
.container {
|
||
background: white;
|
||
padding: 50px;
|
||
border-radius: 20px;
|
||
box-shadow: 0 30px 80px rgba(0,0,0,0.4);
|
||
max-width: 800px;
|
||
width: 100%;
|
||
text-align: center;
|
||
}
|
||
|
||
h1 {
|
||
color: #ef4444;
|
||
font-size: 36px;
|
||
margin-bottom: 20px;
|
||
animation: pulse 2s infinite;
|
||
}
|
||
|
||
@keyframes pulse {
|
||
0%, 100% { opacity: 1; }
|
||
50% { opacity: 0.7; }
|
||
}
|
||
|
||
.status {
|
||
font-size: 24px;
|
||
margin: 30px 0;
|
||
padding: 25px;
|
||
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
||
color: white;
|
||
border-radius: 15px;
|
||
font-weight: bold;
|
||
}
|
||
|
||
.button-container {
|
||
margin: 40px 0;
|
||
}
|
||
|
||
button {
|
||
background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
|
||
color: white;
|
||
border: none;
|
||
padding: 20px 50px;
|
||
font-size: 20px;
|
||
font-weight: bold;
|
||
border-radius: 50px;
|
||
cursor: pointer;
|
||
transition: all 0.3s ease;
|
||
box-shadow: 0 10px 30px rgba(34, 197, 94, 0.4);
|
||
}
|
||
|
||
button:hover {
|
||
transform: translateY(-3px);
|
||
box-shadow: 0 15px 40px rgba(34, 197, 94, 0.6);
|
||
}
|
||
|
||
button:active {
|
||
transform: translateY(0);
|
||
}
|
||
|
||
.steps {
|
||
text-align: left;
|
||
margin: 30px 0;
|
||
background: #f8f9fa;
|
||
padding: 30px;
|
||
border-radius: 15px;
|
||
}
|
||
|
||
.steps h3 {
|
||
color: #667eea;
|
||
margin-bottom: 20px;
|
||
font-size: 22px;
|
||
}
|
||
|
||
.steps ol {
|
||
padding-left: 25px;
|
||
}
|
||
|
||
.steps li {
|
||
margin: 15px 0;
|
||
line-height: 1.8;
|
||
font-size: 16px;
|
||
}
|
||
|
||
.keyboard-combo {
|
||
display: inline-block;
|
||
background: #2d3748;
|
||
color: #68d391;
|
||
padding: 5px 12px;
|
||
border-radius: 6px;
|
||
font-family: 'Courier New', monospace;
|
||
font-weight: bold;
|
||
margin: 0 5px;
|
||
}
|
||
|
||
.warning-box {
|
||
background: #fff3cd;
|
||
border: 3px solid #ffc107;
|
||
padding: 25px;
|
||
border-radius: 15px;
|
||
margin: 30px 0;
|
||
}
|
||
|
||
.warning-box h3 {
|
||
color: #856404;
|
||
margin-bottom: 15px;
|
||
}
|
||
|
||
.success-box {
|
||
background: #d4edda;
|
||
border: 3px solid #28a745;
|
||
padding: 25px;
|
||
border-radius: 15px;
|
||
margin: 30px 0;
|
||
display: none;
|
||
}
|
||
|
||
.success-box h3 {
|
||
color: #155724;
|
||
margin-bottom: 15px;
|
||
}
|
||
|
||
.timer {
|
||
font-size: 48px;
|
||
font-weight: bold;
|
||
color: #667eea;
|
||
margin: 20px 0;
|
||
}
|
||
|
||
.fixed-files {
|
||
background: #e7f5ff;
|
||
padding: 20px;
|
||
border-radius: 10px;
|
||
margin: 20px 0;
|
||
text-align: left;
|
||
}
|
||
|
||
.fixed-files h4 {
|
||
color: #1971c2;
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.fixed-files ul {
|
||
list-style: none;
|
||
padding: 0;
|
||
}
|
||
|
||
.fixed-files li {
|
||
padding: 8px 0;
|
||
border-bottom: 1px solid #a5d8ff;
|
||
}
|
||
|
||
.fixed-files li:last-child {
|
||
border-bottom: none;
|
||
}
|
||
|
||
code {
|
||
background: #2d3748;
|
||
color: #68d391;
|
||
padding: 2px 8px;
|
||
border-radius: 4px;
|
||
font-family: 'Courier New', monospace;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div class="container">
|
||
<h1>🚨 紧急缓存清除工具</h1>
|
||
|
||
<div class="status" id="status">
|
||
检测到 DialogDescription 导入错误 - 需要清除缓存
|
||
</div>
|
||
|
||
<div class="fixed-files">
|
||
<h4>✅ 已修复的文件:</h4>
|
||
<ul>
|
||
<li>📄 <code>/components/config/OperationLog.tsx</code> - DialogDescription 已导入</li>
|
||
<li>📄 <code>/components/config/NetworkLog.tsx</code> - DialogDescription 已导入</li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="button-container">
|
||
<button onclick="forceClearCache()">🔥 立即清除缓存并重新加载</button>
|
||
</div>
|
||
|
||
<div class="timer" id="timer" style="display: none;">
|
||
3
|
||
</div>
|
||
|
||
<div class="steps">
|
||
<h3>📋 手动清除缓存步骤(如果自动清除失败):</h3>
|
||
<ol>
|
||
<li>
|
||
<strong>Windows/Linux 用户:</strong>
|
||
<br>按 <span class="keyboard-combo">Ctrl + Shift + Delete</span> 打开清除浏览数据对话框
|
||
</li>
|
||
<li>
|
||
<strong>Mac 用户:</strong>
|
||
<br>按 <span class="keyboard-combo">Cmd + Shift + Delete</span> 打开清除浏览数据对话框
|
||
</li>
|
||
<li>
|
||
在对话框中:
|
||
<ul style="margin-top: 10px;">
|
||
<li>✅ 勾选 "缓存的图片和文件"</li>
|
||
<li>✅ 时间范围选择 "全部时间"</li>
|
||
<li>✅ 点击 "清除数据" 按钮</li>
|
||
</ul>
|
||
</li>
|
||
<li>完全关闭浏览器(关闭所有标签页)</li>
|
||
<li>重新打开浏览器并访问应用</li>
|
||
</ol>
|
||
</div>
|
||
|
||
<div class="warning-box">
|
||
<h3>⚠️ 重要提示</h3>
|
||
<p>如果清除缓存后问题仍然存在,请尝试以下操作:</p>
|
||
<ol style="margin-top: 15px; padding-left: 25px;">
|
||
<li>停止开发服务器(按 <span class="keyboard-combo">Ctrl + C</span>)</li>
|
||
<li>等待 3-5 秒</li>
|
||
<li>重新启动开发服务器</li>
|
||
<li>使用隐私/无痕模式打开应用</li>
|
||
</ol>
|
||
</div>
|
||
|
||
<div class="success-box" id="successBox">
|
||
<h3>✅ 缓存已清除!</h3>
|
||
<p>页面将在 <span id="countdown">3</span> 秒后自动重新加载...</p>
|
||
</div>
|
||
|
||
<div class="steps">
|
||
<h3>🔍 验证修复:</h3>
|
||
<ol>
|
||
<li>访问 <strong>系统管理 → 日志管理 → 操作日志</strong></li>
|
||
<li>点击任意日志的 "查看" 按钮</li>
|
||
<li>确认详情对话框能正常打开,无 DialogDescription 错误</li>
|
||
<li>访问 <strong>系统管理 → 日志管理 → 网络日志</strong></li>
|
||
<li>重复步骤 2-3</li>
|
||
</ol>
|
||
</div>
|
||
</div>
|
||
|
||
<script>
|
||
console.clear();
|
||
console.log('%c🔧 DialogDescription 修复工具', 'color: #22c55e; font-size: 20px; font-weight: bold;');
|
||
console.log('%c以下文件已修复:', 'color: #3b82f6; font-size: 14px;');
|
||
console.log('%c ✅ /components/config/OperationLog.tsx', 'color: #10b981; font-size: 12px;');
|
||
console.log('%c ✅ /components/config/NetworkLog.tsx', 'color: #10b981; font-size: 12px;');
|
||
|
||
function forceClearCache() {
|
||
const statusEl = document.getElementById('status');
|
||
const successBox = document.getElementById('successBox');
|
||
const timerEl = document.getElementById('timer');
|
||
const countdownEl = document.getElementById('countdown');
|
||
|
||
// 更新状态
|
||
statusEl.textContent = '正在清除缓存...';
|
||
statusEl.style.background = 'linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%)';
|
||
|
||
// 显示倒计时
|
||
timerEl.style.display = 'block';
|
||
|
||
// 尝试清除各种缓存
|
||
try {
|
||
// 清除 localStorage
|
||
if (typeof localStorage !== 'undefined') {
|
||
const keys = Object.keys(localStorage);
|
||
console.log(`清除 ${keys.length} 个 localStorage 项...`);
|
||
// 不清除认证信息
|
||
keys.forEach(key => {
|
||
if (!key.includes('auth') && !key.includes('user')) {
|
||
localStorage.removeItem(key);
|
||
}
|
||
});
|
||
}
|
||
|
||
// 清除 sessionStorage
|
||
if (typeof sessionStorage !== 'undefined') {
|
||
console.log('清除 sessionStorage...');
|
||
sessionStorage.clear();
|
||
}
|
||
|
||
// 尝试清除 Service Worker 缓存
|
||
if ('caches' in window) {
|
||
caches.keys().then(names => {
|
||
names.forEach(name => {
|
||
console.log(`清除缓存: ${name}`);
|
||
caches.delete(name);
|
||
});
|
||
});
|
||
}
|
||
|
||
console.log('%c✅ 缓存清除完成!', 'color: #22c55e; font-size: 16px; font-weight: bold;');
|
||
|
||
} catch (e) {
|
||
console.error('清除缓存时出错:', e);
|
||
}
|
||
|
||
// 倒计时动画
|
||
let count = 3;
|
||
const countdown = setInterval(() => {
|
||
count--;
|
||
timerEl.textContent = count;
|
||
if (countdownEl) {
|
||
countdownEl.textContent = count;
|
||
}
|
||
|
||
if (count === 0) {
|
||
clearInterval(countdown);
|
||
statusEl.textContent = '正在重新加载...';
|
||
statusEl.style.background = 'linear-gradient(135deg, #22c55e 0%, #16a34a 100%)';
|
||
|
||
// 显示成功消息
|
||
successBox.style.display = 'block';
|
||
timerEl.style.display = 'none';
|
||
|
||
// 硬刷新页面
|
||
setTimeout(() => {
|
||
window.location.href = window.location.href + '?nocache=' + new Date().getTime();
|
||
window.location.reload(true);
|
||
}, 500);
|
||
}
|
||
}, 1000);
|
||
}
|
||
|
||
// 页面加载时自动检测
|
||
window.addEventListener('load', () => {
|
||
console.log('%c⚠️ 如果仍然看到 DialogDescription 错误,请点击按钮清除缓存', 'color: #f59e0b; font-size: 14px;');
|
||
|
||
// 5秒后自动提示
|
||
setTimeout(() => {
|
||
if (confirm('是否立即清除缓存并重新加载页面?\n\n这将修复 DialogDescription 导入错误。')) {
|
||
forceClearCache();
|
||
}
|
||
}, 3000);
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|