feat: 使用中间件 从 jwt 中获取用户信息

This commit is contained in:
Ivan
2021-07-09 18:20:36 +08:00
parent 5ed17cc04b
commit 02059ee54f
15 changed files with 6721 additions and 4810 deletions

View File

@@ -0,0 +1,10 @@
import { Injectable, NestMiddleware } from '@nestjs/common';
import { raw } from 'body-parser';
import { Request, Response, NextFunction } from 'express';
@Injectable()
export class RawBodyMiddleware implements NestMiddleware {
use(req: Request, res: Response, next: NextFunction) {
raw({ type: '*/*' })(req, res, next);
}
}