增加登录日志

This commit is contained in:
hanhh
2021-09-07 01:40:25 +08:00
parent 0cbfca979e
commit eb196bd40d
11 changed files with 233 additions and 12 deletions
+15
View File
@@ -167,4 +167,19 @@ export default (app: Router) => {
}
},
);
route.get(
'/user/login-log',
async (req: Request, res: Response, next: NextFunction) => {
const logger: Logger = Container.get('logger');
try {
const authService = Container.get(AuthService);
const data = await authService.getLoginLog();
res.send({ code: 200, data });
} catch (e) {
logger.error('🔥 error: %o', e);
return next(e);
}
},
);
};