fix(account middleware): 使用了未定义的变量。
This commit is contained in:
parent
02059ee54f
commit
c3c73fbe65
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user