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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user