|
@@ -104,7 +104,7 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
|
|
|
AppType: mv.AppType,
|
|
|
OpenType: mv.OpenType,
|
|
|
},
|
|
|
- Match: strings.Split(mv.Match, ","),
|
|
|
+ Match: MC.If(mv.Match != "", strings.Split(mv.Match, ","), []string{}).([]string),
|
|
|
}
|
|
|
if len(mv.Children) > 0 {
|
|
|
for _, sv := range mv.Children {
|
|
@@ -132,7 +132,7 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
|
|
|
AppType: sv.AppType,
|
|
|
OpenType: sv.OpenType,
|
|
|
},
|
|
|
- Match: strings.Split(mv.Match, ","),
|
|
|
+ Match: MC.If(sv.Match != "", strings.Split(sv.Match, ","), []string{}).([]string),
|
|
|
}
|
|
|
if len(sv.Children) > 0 {
|
|
|
for _, tv := range sv.Children {
|
|
@@ -159,7 +159,7 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
|
|
|
AppType: tv.AppType,
|
|
|
OpenType: tv.OpenType,
|
|
|
},
|
|
|
- Match: strings.Split(mv.Match, ","),
|
|
|
+ Match: MC.If(tv.Match != "", strings.Split(tv.Match, ","), []string{}).([]string),
|
|
|
}
|
|
|
if len(tv.Children) > 0 {
|
|
|
L:
|
|
@@ -182,7 +182,7 @@ func (m *WorkDesktopMenu) WorkMenuFormat() ([]*pb.MenuList, error) {
|
|
|
OpenType: fv.OpenType,
|
|
|
}
|
|
|
}
|
|
|
- threeLevel.Match = strings.Split(fv.Match, ",")
|
|
|
+ threeLevel.Match = MC.If(fv.Match != "", strings.Split(fv.Match, ","), []string{}).([]string)
|
|
|
//四级菜单必须有顺序性,大会员》商机管理》超级订阅》免费用户
|
|
|
name := MC.If(strings.Contains(fv.Name, "-"), strings.Split(fv.Name, "-")[0], "免费").(string)
|
|
|
if len(UserRolePowers[name]) > 0 && m.VerifyPermissions(strings.Join(UserRolePowers[name], ",")) {
|
|
@@ -298,7 +298,7 @@ func (m *WorkDesktopMenu) CommonlyFormat(childMenus map[int][]*JYMenu) ([]*pb.Th
|
|
|
AppType: mv.AppType,
|
|
|
OpenType: mv.OpenType,
|
|
|
},
|
|
|
- Match: strings.Split(mv.Match, ","),
|
|
|
+ Match: MC.If(mv.Match != "", strings.Split(mv.Match, ","), []string{}).([]string),
|
|
|
}
|
|
|
//处理子级
|
|
|
if childMenus[mv.Id] != nil && len(childMenus[mv.Id]) > 0 {
|
|
@@ -326,7 +326,7 @@ func (m *WorkDesktopMenu) CommonlyFormat(childMenus map[int][]*JYMenu) ([]*pb.Th
|
|
|
OpenType: cv.OpenType,
|
|
|
}
|
|
|
}
|
|
|
- oneLevel.Match = strings.Split(cv.Match, ",")
|
|
|
+ oneLevel.Match = MC.If(cv.Match != "", strings.Split(cv.Match, ","), []string{}).([]string)
|
|
|
name := MC.If(strings.Contains(cv.Name, "-"), strings.Split(cv.Name, "-")[0], "免费").(string)
|
|
|
if len(UserRolePowers[name]) > 0 && m.VerifyPermissions(strings.Join(UserRolePowers[name], ",")) {
|
|
|
break L
|