优化:Office/CSV 预览增强 + 清理冗余代码
Office 预览优化: - 重构 Excel/Word 预览,使用本地文件服务器直接加载 - 添加 CSV 文件预览支持(表格形式展示) - 优化加载状态和错误提示 UI CSV 文件支持: - 后端添加 CSV/TSV 文件类型和 MIME 映射 - 前端添加 isCsvFile 类型判断 代码清理: - 移除未使用的 ReadFileAsBase64 API
This commit is contained in:
@@ -284,13 +284,16 @@ func getAllowedExtensions() map[string]bool {
|
||||
".ppt": true,
|
||||
".pptx": true,
|
||||
// 文本
|
||||
".txt": true,
|
||||
".md": true,
|
||||
".txt": true,
|
||||
".md": true,
|
||||
".json": true,
|
||||
".xml": true,
|
||||
".html": true,
|
||||
".css": true,
|
||||
".js": true,
|
||||
// 表格
|
||||
".csv": true,
|
||||
".tsv": true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,5 +370,8 @@ func getMIMETypeMapping() map[string]string {
|
||||
".json": "application/json",
|
||||
".xml": "application/xml",
|
||||
".md": "text/markdown",
|
||||
// 表格
|
||||
".csv": "text/csv; charset=utf-8",
|
||||
".tsv": "text/tab-separated-values; charset=utf-8",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user