deving
This commit is contained in:
+8
-21
@@ -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();
|
||||
}
|
||||
|
||||
// 添加显示函数
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<div style="display: flex; justify-content: space-between; align-items: center;">
|
||||
<p>PythonOCC 可用: {{ pythonocc_available }} | 服务版本: 3.0.0</p>
|
||||
<div>
|
||||
<button class="upload-btn" onclick="goToHistory()" style="background: linear-gradient(135deg, #666, #555); margin-left: 10px;">
|
||||
<button class="upload-btn" onclick="goToHistory()" style="margin-left: 10px;">
|
||||
📋 查看历史记录
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user