mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
Merge branch 'main' into next
This commit is contained in:
commit
4362709ccd
@ -21,6 +21,7 @@
|
||||
"antd": "5.x",
|
||||
"cos-nodejs-sdk-v5": "^2.11.14",
|
||||
"koa-static": "^5.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"mime-match": "^1.0.2",
|
||||
"mkdirp": "~0.5.4",
|
||||
"multer": "^1.4.2",
|
||||
|
@ -8,11 +8,13 @@
|
||||
*/
|
||||
|
||||
import { uid } from '@nocobase/utils';
|
||||
import iconv from 'iconv-lite';
|
||||
import path from 'path';
|
||||
|
||||
export function getFilename(req, file, cb) {
|
||||
const baseName = path.basename(file.originalname, path.extname(file.originalname));
|
||||
cb(null, `${baseName}-${uid(6)}${path.extname(file.originalname)}`);
|
||||
const originalname = iconv.decode(Buffer.from(file.originalname, 'binary'), 'utf8');
|
||||
const baseName = path.basename(originalname, path.extname(originalname));
|
||||
cb(null, `${baseName}-${uid(6)}${path.extname(originalname)}`);
|
||||
}
|
||||
|
||||
export const cloudFilenameGetter = (storage) => (req, file, cb) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user