feat: 新增系统操作日志&其他优化

This commit is contained in:
meilin.huang
2022-07-14 11:39:12 +08:00
parent 1c18a01bf6
commit db554ebdc9
38 changed files with 6783 additions and 1388 deletions

View File

@@ -20,7 +20,7 @@ func InitRoleRouter(router *gin.RouterGroup) {
ctx.NewReqCtxWithGin(c).Handle(r.Roles)
})
saveRole := ctx.NewLogInfo("保存角色")
saveRole := ctx.NewLogInfo("保存角色").WithSave(true)
sPermission := ctx.NewPermission("role:add")
db.POST("", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(saveRole).
@@ -28,7 +28,7 @@ func InitRoleRouter(router *gin.RouterGroup) {
Handle(r.SaveRole)
})
delRole := ctx.NewLogInfo("删除角色")
delRole := ctx.NewLogInfo("删除角色").WithSave(true)
drPermission := ctx.NewPermission("role:del")
db.DELETE(":id", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(delRole).
@@ -44,7 +44,7 @@ func InitRoleRouter(router *gin.RouterGroup) {
ctx.NewReqCtxWithGin(c).Handle(r.RoleResource)
})
saveResource := ctx.NewLogInfo("保存角色资源")
saveResource := ctx.NewLogInfo("保存角色资源").WithSave(true)
srPermission := ctx.NewPermission("role:saveResources")
db.POST(":id/resources", func(c *gin.Context) {
ctx.NewReqCtxWithGin(c).WithLog(saveResource).