Skip to content

Commit a0b429d

Browse files
authored
Merge pull request #32 from wangle201210/feat/excel
添加excel解析
2 parents e31aa81 + 37607f2 commit a0b429d

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ build-linux:
4141
run-by-docker:
4242
docker compose -f docker-compose.yml up -d
4343

44-
v := v0.0.1
44+
v := v0.0.2
4545
buildx:
4646
docker buildx build \
4747
--platform linux/arm64,linux/amd64 \

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22

33
services:
44
go-rag:
5-
image: iwangle/go-rag:v0.0.1
5+
image: iwangle/go-rag:v0.0.2
66
# build:
77
# context: .
88
# dockerfile: Dockerfile

fe/src/pages/rag/indexer.vue

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,13 @@ const indexResult = ref(null)
99
const knowledgeSelectorRef = ref(null)
1010
1111
function beforeUpload(file) {
12-
// 检查文件类型 - 支持更多格式
13-
const allowedTypes = [
14-
'application/pdf',
15-
'text/markdown',
16-
'text/html',
17-
'text/plain',
18-
'text/csv',
19-
'application/vnd.ms-excel',
20-
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
21-
]
22-
2312
// 检查文件扩展名
24-
const allowedExtensions = ['.pdf', '.md', '.markdown', '.html', '.htm', '.txt', '.csv', '.json', '.xlsx']
13+
const allowedExtensions = ['.pdf', '.md', '.markdown', '.html', '.htm', '.txt', '.csv', '.xlsx']
2514
const fileExtension = file.name.toLowerCase().substring(file.name.lastIndexOf('.'))
26-
27-
const isAllowedType = allowedTypes.includes(file.type)
2815
const isAllowedExtension = allowedExtensions.includes(fileExtension)
2916
30-
if (!isAllowedType && !isAllowedExtension) {
31-
ElMessage.error('支持的文件格式:PDF、Markdown、HTML、TXT、CSV、JSON文件!')
17+
if (!isAllowedExtension) {
18+
ElMessage.error('支持的文件格式:PDF、Markdown、HTML、TXT、CSV、XLSX文件!')
3219
return false
3320
}
3421

0 commit comments

Comments
 (0)