Skip to content

Commit 7dfc221

Browse files
committed
fix: 上传文本文件去掉csv
--bug=1049721 --user=刘瑞斌 【知识库】上传文本文件夹,里面包含csv文件,csv文件也能上传成功 https://www.tapd.cn/57709429/s/1620432
1 parent b43f031 commit 7dfc221

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ui/src/utils/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function fileType(name: string) {
3838
获得文件对应图片
3939
*/
4040
const typeList: any = {
41-
txt: ['txt', 'pdf', 'docx', 'csv', 'md', 'html'],
41+
txt: ['txt', 'pdf', 'docx', 'md', 'html'],
4242
table: ['xlsx', 'xls', 'csv'],
4343
QA: ['xlsx', 'csv', 'xls']
4444
}

ui/src/views/dataset/component/UploadComponent.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
action="#"
130130
:auto-upload="false"
131131
:show-file-list="false"
132-
accept=".txt, .md, .csv, .log, .docx, .pdf, .html"
132+
accept=".txt, .md, .log, .docx, .pdf, .html"
133133
:limit="50"
134134
:on-exceed="onExceed"
135135
:on-change="fileHandleChange"
@@ -215,6 +215,7 @@ function deleteFile(index: number) {
215215
216216
// 上传on-change事件
217217
const fileHandleChange = (file: any, fileList: UploadFiles) => {
218+
console.log(file)
218219
//1、判断文件大小是否合法,文件限制不能大于100M
219220
const isLimit = file?.size / 1024 / 1024 < 100
220221
if (!isLimit) {

0 commit comments

Comments
 (0)