fix: chinese name export (#4890)

* fix: chinese name export

* fix: xlsx white space

* doc

* doc
This commit is contained in:
Archer
2025-05-25 21:19:29 +08:00
committed by GitHub
parent 1dea2b71b4
commit 874300a56a
5 changed files with 12 additions and 9 deletions

View File

@@ -30,4 +30,5 @@ weight: 790
2. 流响应捕获 finish_reason 可能不正确。
3. 工具调用模式,未保存思考输出。
4. 知识库 indexSize 参数未生效。
5. 工作流嵌套 2 层后,获取预览引用、上下文不正确。
5. 工作流嵌套 2 层后,获取预览引用、上下文不正确。
6. xlsx 转成 Markdown 时候,前面会多出一个空格。

View File

@@ -28,7 +28,6 @@ FastGPT 商业版是基于 FastGPT 开源版的增强版本,增加了一些独
| 应用发布安全配置 | ❌ | ✅ | ✅ |
| 内容审核 | ❌ | ✅ | ✅ |
| web站点同步 | ❌ | ✅ | ✅ |
| 主流文档库接入(目前支持:语雀、飞书) | ❌ | ✅ | ✅ |
| 增强训练模式 | ❌ | ✅ | ✅ |
| 第三方应用快速接入(飞书、公众号) | ❌ | ✅ | ✅ |
| 管理后台 | ❌ | ✅ | 不需要 |

View File

@@ -28,11 +28,11 @@ export const readXlsxRawText = async ({
if (!header) return;
const formatText = `| ${header.join(' | ')} |
| ${header.map(() => '---').join(' | ')} |
${csvArr
.slice(1)
.map((row) => `| ${row.map((item) => item.replace(/\n/g, '\\n')).join(' | ')} |`)
.join('\n')}`;
| ${header.map(() => '---').join(' | ')} |
${csvArr
.slice(1)
.map((row) => `| ${row.map((item) => item.replace(/\n/g, '\\n')).join(' | ')} |`)
.join('\n')}`;
return formatText;
})

View File

@@ -48,7 +48,7 @@ async function handler(req: ApiRequestProps<backupBody, backupQuery>, res: ApiRe
encoding: file.encoding,
getFormatText: false
});
if (!rawText.startsWith('q,a,indexes')) {
if (!rawText.trim().startsWith('q,a,indexes')) {
return Promise.reject('Backup file start with "q,a,indexes"');
}
// 2. delete tmp file

View File

@@ -50,7 +50,10 @@ async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
});
res.setHeader('Content-Type', 'text/csv; charset=utf-8;');
res.setHeader('Content-Disposition', `attachment; filename=${dataset.name}-backup.csv;`);
res.setHeader(
'Content-Disposition',
`attachment; filename=${encodeURIComponent(dataset.name)}-backup.csv;`
);
const cursor = MongoDatasetData.find<DataItemType>(
{