mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
fix: chinese name export (#4890)
* fix: chinese name export * fix: xlsx white space * doc * doc
This commit is contained in:
@@ -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
|
||||
|
@@ -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>(
|
||||
{
|
||||
|
Reference in New Issue
Block a user