完善博客评论功能

This commit is contained in:
2024-08-31 13:38:22 +08:00
parent 29f2c09a69
commit 8ea3a7b25c
5 changed files with 110 additions and 16 deletions

View File

@@ -0,0 +1,11 @@
import { Request, Response, NextFunction } from "express"
import Logger from "../Logger";
const logger = new Logger('MountUserAgent')
let MountUserAgent = (req: Request, res: Response, next: NextFunction) => {
req.body._userAgent = req.headers['user-agent'];
logger.info(`[${req.method}][${req.url.split('?')[0]}] 用户代理解析成功:${req.body._userAgent}`);
next();
}
export default MountUserAgent;