fix(account middleware): 使用了未定义的变量。

This commit is contained in:
Ivan Li 2021-07-10 17:37:21 +08:00
parent 02059ee54f
commit c3c73fbe65
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ export class AccountMiddleware implements NestMiddleware {
async use(req: any, res: any, next: () => void) {
const authPayload = req.header('authorization') ?? '';
if (!authPayload) {
req.user = req.session.user;
req.user = req.session?.user;
next();
return;
}