更新
This commit is contained in:
1 parent
012f8edf8b
commit
36ff960fbd
33 files changed
+1644
-344
No files matched your search
@@ -76,6 +76,7 @@ type menuPayload struct {
|
||||
Sort *int64 `json:"sort"`
|
||||
Status *int8 `json:"status"`
|
||||
IsVisible *int8 `json:"is_visible"`
|
||||
RequireLogin *int8 `json:"require_login"` // 1=必须登录(默认) 0=可免登录(游客可用)
|
||||
Views []int `json:"views"`
|
||||
Platforms []string `json:"platforms"` // 展示端:["web"] ["app"] ["web","app"];空=继承所属模块
|
||||
Type *int8 `json:"type"`
|
||||
@@ -417,6 +418,7 @@ type menuNode struct {
|
||||
Sort int64 `json:"sort"`
|
||||
Status int8 `json:"status"`
|
||||
IsVisible *int8 `json:"is_visible,omitempty"`
|
||||
RequireLogin int8 `json:"require_login"` // 1=必须登录 0=可免登录(游客)
|
||||
Views []int `json:"views,omitempty"`
|
||||
Platforms []string `json:"platforms,omitempty"` // 展示端,空=继承所属模块
|
||||
Type int8 `json:"type"`
|
||||
@@ -430,15 +432,16 @@ func buildMenuTree(menus []models.SystemMenu, pid int64) []*menuNode {
|
||||
for _, m := range menus {
|
||||
if m.Pid == pid {
|
||||
node := &menuNode{
|
||||
ID: m.ID,
|
||||
Pid: m.Pid,
|
||||
Title: m.Title,
|
||||
Sort: m.Sort,
|
||||
Status: m.Status,
|
||||
IsVisible: m.IsVisible,
|
||||
Views: parseViews(m.Views),
|
||||
Platforms: services.ParsePlatforms(m.Platforms),
|
||||
Type: m.Type,
|
||||
ID: m.ID,
|
||||
Pid: m.Pid,
|
||||
Title: m.Title,
|
||||
Sort: m.Sort,
|
||||
Status: m.Status,
|
||||
IsVisible: m.IsVisible,
|
||||
RequireLogin: m.RequireLogin,
|
||||
Views: parseViews(m.Views),
|
||||
Platforms: services.ParsePlatforms(m.Platforms),
|
||||
Type: m.Type,
|
||||
}
|
||||
if m.Path != nil {
|
||||
node.Path = *m.Path
|
||||
@@ -514,6 +517,7 @@ func (c *BackendMenuController) CreateMenu() {
|
||||
Sort: valueInt64(payload.Sort, 0),
|
||||
Status: valueInt8(payload.Status, 1),
|
||||
IsVisible: ptrInt8(valueInt8(payload.IsVisible, 1)),
|
||||
RequireLogin: valueInt8(payload.RequireLogin, 1),
|
||||
Views: &viewsStr,
|
||||
Type: valueInt8(payload.Type, 1),
|
||||
Path: ptrString(valueString(payload.Path, "")),
|
||||
@@ -565,6 +569,7 @@ func (c *BackendMenuController) UpdateMenu() {
|
||||
"sort": valueInt64(payload.Sort, 0),
|
||||
"status": valueInt8(payload.Status, 1),
|
||||
"is_visible": valueInt8(payload.IsVisible, 1),
|
||||
"require_login": valueInt8(payload.RequireLogin, 1),
|
||||
"views": string(viewsBytes),
|
||||
"platforms": services.NormalizePlatforms(payload.Platforms),
|
||||
"type": valueInt8(payload.Type, 1),
|
||||
|
||||
Reference in new issue
Block a user