mirror of
https://github.com/crystelf/crystelf-core.git
synced 2025-07-04 14:49:19 +00:00
multer特殊处理
This commit is contained in:
parent
466eb75067
commit
2c045183ac
@ -14,7 +14,14 @@ const apps = {
|
|||||||
paths.init();
|
paths.init();
|
||||||
logger.info('晶灵核心初始化..');
|
logger.info('晶灵核心初始化..');
|
||||||
|
|
||||||
app.use(express.json());
|
app.use((req, res, next) => {
|
||||||
|
const contentType = req.headers['content-type'] || '';
|
||||||
|
if (contentType.includes('multipart/form-data')) {
|
||||||
|
next();
|
||||||
|
} else {
|
||||||
|
express.json()(req, res, next);
|
||||||
|
}
|
||||||
|
});
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
logger.debug('成功加载 express.json() 中间件');
|
logger.debug('成功加载 express.json() 中间件');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user