aa
This commit is contained in:
@@ -18,8 +18,15 @@ func GetMenu(ctx *jxcontext.Context, userID string) (menus []*model.Menu, err er
|
|||||||
if userID == "" {
|
if userID == "" {
|
||||||
return dao.GetMenu(dao.GetDB(), "", 0, userID)
|
return dao.GetMenu(dao.GetDB(), "", 0, userID)
|
||||||
} else {
|
} else {
|
||||||
return dao.GetMenuWithUser(dao.GetDB(), "", 0, userID)
|
if user, err := dao.GetUserByID(dao.GetDB(), "user_id", userID); err == nil {
|
||||||
|
if user.Type&model.UserTypeRole != 0 {
|
||||||
|
return dao.GetMenuWithUser(dao.GetDB(), "", 0, userID)
|
||||||
|
} else {
|
||||||
|
return dao.GetMenu(dao.GetDB(), "", 0, "")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return dao.GetMenu(dao.GetDB(), "", 0, userID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func AddMenu(ctx *jxcontext.Context, menu *model.Menu) (err error) {
|
func AddMenu(ctx *jxcontext.Context, menu *model.Menu) (err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user