This commit is contained in:
cjw
2026-02-16 01:52:25 +08:00
parent 5c8765326a
commit 0f0e397110
2 changed files with 9 additions and 22 deletions
+8 -21
View File
@@ -568,27 +568,14 @@ function hideError() {
errorMessage.style.display = 'none';
}
// 通过POST请求跳转到历史页面
async function goToHistory() {
try {
const response = await fetch('/history', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
});
if (response.ok) {
// 如果返回的是HTML页面,直接重定向
window.location.href = '/history';
} else {
throw new Error('跳转失败');
}
} catch (error) {
console.error('跳转到历史页面失败:', error);
// 如果POST失败,尝试直接GET跳转
window.location.href = '/history';
}
// 跳转到历史页面
function goToHistory() {
// 创建表单进行POST请求跳转,更安全
const form = document.createElement('form');
form.method = 'POST';
form.action = '/history';
document.body.appendChild(form);
form.submit();
}
// 添加显示函数