mirror of
https://github.com/certd/certd.git
synced 2026-07-26 13:57:46 +08:00
feat: 支持审计日志,操作日志
This commit is contained in:
@@ -6,6 +6,7 @@ import { UserGrantSetting } from "../../../modules/mine/service/models.js";
|
||||
import { isPlus } from "@certd/plus-core";
|
||||
import { merge } from "lodash-es";
|
||||
import { ApiTags } from "@midwayjs/swagger";
|
||||
import { AuditType } from "../../../modules/sys/enterprise/service/audit-constants.js";
|
||||
|
||||
/**
|
||||
*/
|
||||
@@ -20,6 +21,10 @@ export class UserSettingsController extends CrudController<UserSettingsService>
|
||||
return this.service;
|
||||
}
|
||||
|
||||
getAuditType(): string {
|
||||
return AuditType.mine;
|
||||
}
|
||||
|
||||
@Post("/page", { description: Constants.per.authOnly, summary: "查询用户设置分页列表" })
|
||||
async page(@Body(ALL) body) {
|
||||
body.query = body.query ?? {};
|
||||
@@ -62,6 +67,7 @@ export class UserSettingsController extends CrudController<UserSettingsService>
|
||||
async save(@Body(ALL) bean: UserSettingsEntity) {
|
||||
bean.userId = this.getUserId();
|
||||
await this.service.save(bean);
|
||||
this.auditLog({ content: "保存了用户设置" });
|
||||
return this.ok({});
|
||||
}
|
||||
|
||||
@@ -88,6 +94,7 @@ export class UserSettingsController extends CrudController<UserSettingsService>
|
||||
merge(setting, bean);
|
||||
|
||||
await this.service.saveSetting(userId, null, setting);
|
||||
this.auditLog({ content: "保存了授权设置" });
|
||||
return this.ok({});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user