mirror of
https://github.com/crystelf/crystelf-core.git
synced 2025-07-04 06:39:18 +00:00
优化
This commit is contained in:
parent
2c045183ac
commit
ebeba44f9d
@ -17,13 +17,14 @@ const apps = {
|
||||
app.use((req, res, next) => {
|
||||
const contentType = req.headers['content-type'] || '';
|
||||
if (contentType.includes('multipart/form-data')) {
|
||||
logger.debug('检测到form-data数据流,跳过加载 express.json() 中间件..');
|
||||
next();
|
||||
} else {
|
||||
express.json()(req, res, next);
|
||||
}
|
||||
});
|
||||
app.use(compression());
|
||||
logger.debug('成功加载 express.json() 中间件');
|
||||
logger.debug('成功加载 express.json() 中间件..');
|
||||
|
||||
const publicPath = paths.get('public');
|
||||
app.use('/public', express.static(publicPath));
|
||||
|
@ -86,6 +86,7 @@ class FileController {
|
||||
return;
|
||||
}
|
||||
|
||||
logger.debug(`检测到上传文件..`);
|
||||
const uploadDir = req.query.dir?.toString() || '';
|
||||
const deleteAfter = parseInt(req.query.expire as string) || 10 * 60;
|
||||
const { fullPath, relativePath } = await this.FileService.saveUploadedFile(
|
||||
|
Loading…
x
Reference in New Issue
Block a user