[0.2.7.8][ci]
All checks were successful
CI / docker-ci (push) Successful in 26s

This commit is contained in:
DSQ
2026-03-23 11:02:00 +08:00
parent c9611fa622
commit 9e3fe7150b
2 changed files with 105 additions and 98 deletions

View File

@@ -494,6 +494,11 @@ uploadForm.addEventListener('submit', async (e) => {
body: formData,
});
clearInterval(timer);
const ct = (resp.headers.get('content-type') || '').toLowerCase();
if (!ct.includes('application/json')) {
const text = await resp.text();
throw new Error(text ? String(text).slice(0, 200) : `HTTP ${resp.status}`);
}
const data = await resp.json();
if (!resp.ok || data.status !== 'success') {
throw new Error(data.message || '上传识别失败');