forked from lxh/go-wxhelper
🐛 修复下发的菜单数据前端无法使用的BUG
This commit is contained in:
parent
735d4d1f27
commit
79fa7196af
@ -7,8 +7,9 @@ import "wechat-robot/pkg/types"
|
||||
type Menu struct {
|
||||
types.BaseDbModel
|
||||
Type types.MenuType `json:"type" gorm:"type:enum('MENU','BUTTON'); default:'MENU'; not null; comment:'菜单类型(菜单或按钮)'"`
|
||||
Name string `json:"name" gorm:"type:varchar(255);not null;comment:'菜单名称'"`
|
||||
Name string `json:"name" gorm:"type:varchar(255);not null;comment:'页面组件名称'"`
|
||||
Path string `json:"path" gorm:"type:varchar(255);comment:'路径'"`
|
||||
Title string `json:"title" gorm:"type:varchar(255);not null;comment:'菜单标题'"`
|
||||
Icon string `json:"icon" gorm:"type:varchar(255);comment:'菜单图标'"`
|
||||
Sort int `json:"sort" gorm:"type:int(3);not null;comment:'排序值(数字越小约靠前)'"`
|
||||
ParentId *string `json:"parentId" gorm:"type:varchar(32);comment:'父级菜单ID(0表示顶级菜单)'"`
|
||||
|
@ -5,8 +5,9 @@ package menu
|
||||
type Item struct {
|
||||
Id string `json:"id"` // 菜单Id
|
||||
Path string `json:"path"` // 访问路径
|
||||
Name string `json:"name"` // 路由名字(对应不要重复,和页面组件的name保持一致)必填
|
||||
Meta ItemMeta `json:"meta"` // 元数据
|
||||
Children []Item `json:"children"` // 子菜单
|
||||
Children []Item `json:"children,omitempty"` // 子菜单
|
||||
}
|
||||
|
||||
// ItemMeta
|
||||
|
@ -14,6 +14,7 @@ type menuRecordItem struct {
|
||||
Type types.MenuType
|
||||
Name string
|
||||
Path string
|
||||
Title string
|
||||
Icon string
|
||||
Sort int
|
||||
ParentId *string
|
||||
|
Loading…
Reference in New Issue
Block a user