feat:增加设置表单路由、去除同步权限删除自定义权限

This commit is contained in:
张坤
2024-08-17 17:48:43 +08:00
parent 33329bc607
commit b91f83b025
2 changed files with 2 additions and 5 deletions

View File

@@ -100,10 +100,5 @@ func (p *SyncPermissionAction) Handle(ctx *builder.Context, query *gorm.DB) erro
return ctx.JSON(200, message.Error(err.Error()))
}
err = db.Client.Model(&model.Permission{}).Where("name NOT IN ?", currentNames).Delete("").Error
if err != nil {
return ctx.JSON(200, message.Error(err.Error()))
}
return ctx.JSON(200, message.Success("操作成功"))
}

View File

@@ -26,6 +26,7 @@ const (
ExportPath = "/api/admin/:resource/export" // 导出数据路径
DetailPath = "/api/admin/:resource/detail" // 导入数据路径
ImportTemplatePath = "/api/admin/:resource/import/template" // 导入模板路径
SettingFormPath = "/api/admin/:resource/setting/form" // 设置表单路径
FormPath = "/api/admin/:resource/:uriKey/form" // 通用表单资源路径
)
@@ -94,6 +95,7 @@ func (p *Template) RouteInit() interface{} {
p.GET(ExportPath, p.ExportRender) // 导出数据
p.POST(ImportPath, p.ImportRender) // 导入数据
p.GET(ImportTemplatePath, p.ImportTemplateRender) // 导入模板
p.GET(SettingFormPath, p.FormRender) // 设置表单
p.GET(FormPath, p.FormRender) // 通用表单资源
return p