fix: trim whitespace from document name in export functions

--bug=1058737 --user=刘瑞斌 【共享资源】web知识库文档中导出excel文档,导出默认文档名称优化 https://www.tapd.cn/62980211/s/1731548
This commit is contained in:
CaptainB 2025-07-15 13:46:38 +08:00
parent 26df300105
commit 2520461544
3 changed files with 6 additions and 6 deletions

View File

@ -159,7 +159,7 @@ const exportDocument: (
loading?: Ref<boolean>,
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
return exportExcel(
document_name + '.xlsx',
document_name.trim() + '.xlsx',
`${prefix.value}/${knowledge_id}/document/${document_id}/export`,
{},
loading,
@ -180,7 +180,7 @@ const exportDocumentZip: (
loading?: Ref<boolean>,
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
return exportFile(
document_name + '.zip',
document_name.trim() + '.zip',
`${prefix.value}/${knowledge_id}/document/${document_id}/export_zip`,
{},
loading,

View File

@ -149,7 +149,7 @@ const exportDocument: (
loading?: Ref<boolean>,
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
return exportExcel(
document_name + '.xlsx',
document_name.trim() + '.xlsx',
`${prefix}/${knowledge_id}/document/${document_id}/export`,
{},
loading,
@ -170,7 +170,7 @@ const exportDocumentZip: (
loading?: Ref<boolean>,
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
return exportFile(
document_name + '.zip',
document_name.trim() + '.zip',
`${prefix}/${knowledge_id}/document/${document_id}/export_zip`,
{},
loading,

View File

@ -149,7 +149,7 @@ const exportDocument: (
loading?: Ref<boolean>,
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
return exportExcel(
document_name + '.xlsx',
document_name.trim() + '.xlsx',
`${prefix}/${knowledge_id}/document/${document_id}/export`,
{},
loading,
@ -170,7 +170,7 @@ const exportDocumentZip: (
loading?: Ref<boolean>,
) => Promise<any> = (document_name, knowledge_id, document_id, loading) => {
return exportFile(
document_name + '.zip',
document_name.trim() + '.zip',
`${prefix}/${knowledge_id}/document/${document_id}/export_zip`,
{},
loading,