fix(ssa): harden spreadsheet upload recognition and guidance

Fix SSA data-context generation for Excel uploads by parsing xlsx/xls via extension-aware paths instead of UTF-8 fallback.
Add on-demand overview rebuild in Agent flow, align xls friendly prompts on frontend/backend, and surface backend upload errors to users.

Made-with: Cursor
This commit is contained in:
2026-03-10 21:37:34 +08:00
parent 4a4771fbbe
commit 08108e81cd
6 changed files with 131 additions and 17 deletions

View File

@@ -91,7 +91,16 @@ export function useAnalysis(): UseAnalysisReturn {
body: formData,
});
if (!response.ok) throw new Error('上传失败');
if (!response.ok) {
let errMsg = '上传失败';
try {
const errData = await response.json();
errMsg = errData?.error || errData?.message || errMsg;
} catch {
// ignore parse error
}
throw new Error(errMsg);
}
const result = await response.json();
setUploadProgress(100);
return result;