备份:修复前完整项目快照 2026-04-19
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
const { body, validationResult } = require('express-validator');
|
||||
|
||||
const validate = (req, res, next) => {
|
||||
const errors = validationResult(req);
|
||||
if (!errors.isEmpty()) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
errors: errors.array()
|
||||
});
|
||||
}
|
||||
next();
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
validate
|
||||
};
|
||||
Reference in New Issue
Block a user