feat(submit): 重构提交流程并加强判题端错误处理

- judge_client 在 solution/problem/source 查询失败时记录系统错误并以 OJ_RE 安全退出,避免判题机崩溃或挂起
- submit.php 抽取 submit_error 助手,AJAX 请求返回纯文本错误,提交页改为 AJAX 流程并增强错误提示
- 修复 reinfo 自动刷新脚本在标签页切回前台后未恢复轮询的 bug
This commit is contained in:
2026-07-09 12:03:12 +08:00
parent 418674806b
commit 5a27c07bba
6 changed files with 292 additions and 132 deletions

View File

@@ -650,6 +650,7 @@ i.icon.spinning {
var maxInterval = 8000; // 最长 8s
var countdown = 0;
var stopped = false;
var completed = false;
function showStatus(text){
var el = document.getElementById('auto-refresh-status');
@@ -688,6 +689,7 @@ i.icon.spinning {
// 判题完成,刷新页面拿到完整错误信息
showStatus('判题完成,正在刷新...');
setTimeout(function(){ location.reload(); }, 400);
completed = true;
stopped = true;
return;
}
@@ -712,7 +714,8 @@ i.icon.spinning {
if (document.hidden) {
stopped = true;
hideStatus();
} else if (!stopped) {
} else if (!completed) {
stopped = false;
countdown = 0;
tick();
}