后端: - 种子数据:超级管理员(admin/admin123)、super_admin 角色、22 条菜单(含按钮权限码)、角色绑定 - admin_menu 扩展 icon/component/hidden 字段(003_schema_ext.sql),手动补齐 entity/do/table - auth 扩展:/auth/info、/auth/codes(仅登录),路由拆分公开/Profile/受保护三组 - 菜单路由:/menu/routes 返回 vben backend 动态路由树(按角色过滤、排序) - RBAC 管理:/admins、/roles、/menus CRUD(含角色绑定、重置密码、菜单授权) - 日志监控:/log/files、/log/tail(尾部读取+关键词过滤+路径穿越防护) - 安全加固:接口鉴权改为「方法+路径→权限码」自动映射,杜绝任意权限码越权 - 修复:gf v2.10.2 不自动替换→cmd 注入;MySQL driver 需显式引入 contrib - 全链路冒烟测试通过(含越权拒绝 30003)
99 lines
1.5 KiB
Go
99 lines
1.5 KiB
Go
// Package dto — RBAC management inputs/outputs.
|
|
package dto
|
|
|
|
type PageQuery struct {
|
|
Page int
|
|
Size int
|
|
Keyword string
|
|
}
|
|
|
|
type AdminItem struct {
|
|
Id uint64
|
|
Username string
|
|
Nickname string
|
|
Status int
|
|
RoleIds []uint64
|
|
RoleNames []string
|
|
CreatedAt string
|
|
}
|
|
|
|
type AdminCreateInput struct {
|
|
Username string
|
|
Password string
|
|
Nickname string
|
|
RoleIds []uint64
|
|
}
|
|
|
|
type AdminUpdateInput struct {
|
|
Id uint64
|
|
Nickname string
|
|
Status int
|
|
RoleIds []uint64
|
|
}
|
|
|
|
type RoleItem struct {
|
|
Id uint64
|
|
Code string
|
|
Name string
|
|
Status int
|
|
MenuIds []uint64
|
|
CreatedAt string
|
|
}
|
|
|
|
type RoleCreateInput struct {
|
|
Code string
|
|
Name string
|
|
Status int
|
|
MenuIds []uint64
|
|
}
|
|
|
|
type RoleUpdateInput struct {
|
|
Id uint64
|
|
Name string
|
|
Status int
|
|
MenuIds []uint64
|
|
}
|
|
|
|
// MenuNode is the full menu tree node used by menu management.
|
|
type MenuNode struct {
|
|
Id uint64
|
|
ParentId uint64
|
|
Name string
|
|
Icon string
|
|
Type int
|
|
Path string
|
|
Component string
|
|
Permission string
|
|
Sort int
|
|
Status int
|
|
Hidden bool
|
|
Children []*MenuNode
|
|
}
|
|
|
|
type MenuCreateInput struct {
|
|
ParentId uint64
|
|
Name string
|
|
Icon string
|
|
Type int
|
|
Path string
|
|
Component string
|
|
Permission string
|
|
Sort int
|
|
Status int
|
|
Hidden bool
|
|
}
|
|
|
|
type MenuUpdateInput struct {
|
|
Id uint64
|
|
ParentId uint64
|
|
Name string
|
|
Icon string
|
|
Type int
|
|
Path string
|
|
Component string
|
|
Permission string
|
|
Sort int
|
|
Status int
|
|
Hidden bool
|
|
}
|