v4.6.6-fix (#676)

This commit is contained in:
Archer
2024-01-02 14:18:51 +08:00
committed by GitHub
parent d645a7406b
commit 2e75851b02
179 changed files with 279 additions and 5964 deletions

View File

@@ -3,6 +3,7 @@ import { customAlphabet } from 'nanoid';
import multer from 'multer';
import path from 'path';
import { BucketNameEnum } from '@fastgpt/global/common/file/constants';
import fs from 'fs';
const nanoid = customAlphabet('1234567890abcdef', 12);
@@ -69,3 +70,13 @@ export function getUploadModel({ maxSize = 500 }: { maxSize?: number }) {
return new UploadModel();
}
export const removeFilesByPaths = (paths: string[]) => {
paths.forEach((path) => {
fs.unlink(path, (err) => {
if (err) {
console.error(err);
}
});
});
};