Private
Public Access
1
0

优化:Office/CSV 预览增强 + 清理冗余代码

Office 预览优化:
- 重构 Excel/Word 预览,使用本地文件服务器直接加载
- 添加 CSV 文件预览支持(表格形式展示)
- 优化加载状态和错误提示 UI

CSV 文件支持:
- 后端添加 CSV/TSV 文件类型和 MIME 映射
- 前端添加 isCsvFile 类型判断

代码清理:
- 移除未使用的 ReadFileAsBase64 API
This commit is contained in:
2026-02-27 18:15:17 +08:00
parent c5e6ff3ba6
commit 1eaf61cf41
10 changed files with 934 additions and 260 deletions

View File

@@ -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",
}
}