mirror of
https://github.com/certd/certd.git
synced 2026-07-15 02:07:38 +08:00
chore: 登录失败也记录日志
This commit is contained in:
@@ -14,18 +14,18 @@ export class AuditLogController extends BaseController {
|
||||
@Post("/page", { description: Constants.per.authOnly, summary: "分页查询当前用户操作日志" })
|
||||
async page(@Body(ALL) body: any) {
|
||||
const { projectId, userId } = await this.getProjectUserIdRead();
|
||||
const query: any = { }
|
||||
const query: any = {};
|
||||
if (projectId) {
|
||||
//如果是项目级别,排除userId参数,因为日志这里userId不是-1 ,而是实际的用户
|
||||
query.projectId = projectId;
|
||||
}else{
|
||||
} else {
|
||||
query.userId = userId;
|
||||
}
|
||||
body.query = {
|
||||
...body.query || {},
|
||||
...(body.query || {}),
|
||||
...query,
|
||||
scope: "user"
|
||||
}
|
||||
scope: "user",
|
||||
};
|
||||
|
||||
const pageRet = await this.auditService.page(body);
|
||||
return this.ok(pageRet);
|
||||
|
||||
@@ -33,7 +33,7 @@ export class DnsPersistRecordController extends CrudController<DnsPersistRecordS
|
||||
const { projectId, userId } = await this.getProjectUserIdWrite();
|
||||
bean.projectId = projectId;
|
||||
bean.userId = userId;
|
||||
const res = await this.getService().add(bean);
|
||||
const res = await this.getService().add(bean);
|
||||
this.auditLog({ content: `新增了DNS持久验证记录(ID:${res.id})` });
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user