fix: replace PDF with HTML report (fontkit unavailable)

This commit is contained in:
Developer
2026-05-21 16:30:36 +08:00
parent 0b0da09d4b
commit a83de861dd
4 changed files with 41 additions and 66 deletions
+2 -6
View File
@@ -923,13 +923,9 @@ export const AssessmentView: React.FC<AssessmentViewProps> = ({
const binary = atob(result.buffer);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
const blob = new Blob([bytes], { type: 'application/pdf' });
const blob = new Blob([bytes], { type: 'text/html;charset=utf-8' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = result.filename;
a.click();
URL.revokeObjectURL(url);
window.open(url, '_blank');
} catch (err) {
setError(t('exportAssessmentFailed'));
}