fix: Standardize file creation timestamp to ISO string format

Ensure consistent ISO string representation of file creation timestamps in both file utility and knowledge content upload
This commit is contained in:
kangfenmao 2025-03-09 17:27:55 +08:00
parent b42da9f154
commit 262213cc8b
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ export function getAllFiles(dirPath: string, arrayOfFiles: FileType[] = []): Fil
count: 1, count: 1,
origin_name: name, origin_name: name,
type: fileType, type: fileType,
created_at: new Date() created_at: new Date().toISOString()
} }
arrayOfFiles.push(fileItem) arrayOfFiles.push(fileItem)

View File

@ -100,7 +100,7 @@ const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
count: 1, count: 1,
origin_name: file.name, origin_name: file.name,
type: file.type as FileTypes, type: file.type as FileTypes,
created_at: new Date() created_at: new Date().toISOString()
})) }))
.filter(({ ext }) => fileTypes.includes(ext)) .filter(({ ext }) => fileTypes.includes(ext))
console.debug('[KnowledgeContent] Uploading files:', _files, files) console.debug('[KnowledgeContent] Uploading files:', _files, files)